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
For rewrite, why is it mandatory that file needs to be opened?
how do you reference the variable block file formats from cobol programs
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What are literals?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
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 are the next sentence and continue different from each other?
Describe the cobol database components?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
how do you define single dimensional array and multidimensional array in your cobol?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
What is the difference between a binary search and a sequential search what are the pertinent cobol?
how to convert the recors form vsam file to db2 table tru file aid
Name the divisions, which are available in a cobol program?