• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 52
  • Last Modified:

In the program why I am getting error in the place of move statemet but not in the place of string verb and the sentence is common like 'VALUE OF A IS ' A. ?

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 9(02) VALUE 21.
77 B PIC X(20).
PROCEDURE DIVISION.
DISPLAY 'Hello, world'.
STRING 'VALUE OF A IS '  A
    DELIMITED BY SIZE INTO B
END-STRING.
DISPLAY B.
MOVE 'VALUE OF A IS  '  A TO B.
DISPLAY B.
STOP RUN.
0
Ananth Sura
Asked:
Ananth Sura
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi Ananth,

Unless you're using a proprietary COBOL extension, the syntax of the MOVE statement is incorrect.  Its syntax is the very simple

  MOVE source TO target

The source item can be a single variable or literal.  

  MOVE 'VALUE OF A IS ' A TO B.

That statement contains two source items instead of the expected 1.


Good Luck,
Kent
0
 
Ananth SuraAuthor Commented:
Thank you so much kent.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now