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
Answers were Sorted based on User's Feedback
Answer / 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 |
is it possible to declare index in cobol program? if it is not why its tell me pls
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?
I got user abend U4038 while compiling my runjcl.. can anyone help me?
Why there is no questions in this column?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?
can I copy book which contain db2 statment in procedure divion?
what is the advantage of sync class
If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
how to transfer the file from pc to mainframe??
What the difference is between continue and next sentence?