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 do you reference the following file formats from cobol programs?
What is static and dynamic call in cobol?
A table has two indexes defined. Which one will be used by the SEARCH?
how to refer the data field?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
) How do u handle errors in BMS macro?
how do you reference the variable unblock file formats from cobol programs
what is amode(24), amode(31), rmode(24) and rmode(any)?
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
IF I mention stop run in CICS what happens?
) how do u code after getting data?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What is rmode(any) ?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.