Will the variable POS in the following code have a value of
2 or not?
01 POS PIC S9(4) COMP VALUE 2.
01 FIRST-NAME PIC X(10) VALUE 'ABC'.
01 LAST-NAME PIC X(10) VALUE 'XYZ'.
01 NAME PIC X(20) VALUE SPACES.
STRING FIRST-NAME DELIMITED BY SPACES
' ' DELIMITED BY SIZE
LAST-NAME DELIMITED BY SPACES
INTO NAME
WITH POINTER POS
Answer Posted / shobhit garg
No, It wont have value 2. rather value of POS will be 9.
Pointer specifies the number of non blank characters moved
to the receiveing string ( in our case its NAME).
So FIRST-NAME will return 3 bytes then a space then LAST-
NAME will return 3 bytes means overall 7 bytes.
Since our POS varibale starts from 2 , so overall count for
POS will be 2 + 7 = 9
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
HOw can I get the negative sign while deduct high value from low value
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
how to access the file from prodution from changeman tool and to submit a file to production
What is the local-storage section?
What is report-item in COBOL?
How to know whether the module is dynamical or statistical?
What is cobol?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What are the pertinent COBOL commands?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
Which is not true about evaluate statement
Which division and paragraphs are mandatory for a COBOL program?
Whats the difference between search & search ALL?
What rules are to be followed while using the corresponding options?