Explore BrainMass
Share

Explore BrainMass

    COBOL Programming

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Hi, I need some help trying to understand the "MOVE" statement in COBOL programming. Can someone help with the following items?

    1.) When do you need to move data, and how is this achieved in your code?
    2) In order for the example below to work, could you have a variable named "field"? How would the variables on either side of the MOVE statement need to be defined as?

    Move string constant "Hi There" to the variable field. Move "Hi There" to field.

    © BrainMass Inc. brainmass.com October 10, 2019, 5:37 am ad1c9bdddf
    https://brainmass.com/computer-science/programming-languages/cobol-programming-511726

    Solution Preview

    Task:

    1. When do you need to move data, and how is this achieved in your code?

    2. In order for the example below to work, could you have a variable named "field"? How would the variables on either side of the MOVE statement need to be defined as?

    Move string constant "Hi There" to the variable field.
    MOVE "Hi There" TO field

    Answer:

    1. In COBOL, the MOVE verb is used to move data to an item. But, proper care must be taken when moving (using the MOVE verb) data to an item. In other languages, when we want to assign a value to XYZ (which is defined at the beginning of the program as an integer for example), then that's it. In COBOL, we ...

    Solution Summary

    The solution contains a word document explaining the "MOVE" statement in COBOL programming language with the help of examples. It also answers when do we need to use it and how to use it.

    $2.19