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
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What is the local-storage section?
In COBOL, what is the different between index and subscript?
For rewrite, why is it mandatory that file needs to be opened?
how do you reference the printer file formats from cobol programs
What are the different types of condition in cobol and write their forms.
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What rules are to be followed while using the corresponding options?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What are the access modes of START statement?