Hello -
I tried a compile, load and go two ways -
One using double quotes to assign the value and one using a hex value.
In both cases the put skip data show two quotes (which is wrong) and the put skip list shows one quote (Which is correct).
Please help to understand if there is any specific reason why PUT SKIP DATA gives a extra quote that PUT SKIP LIST does not give.
SURNAME = 'O' || '7D'X || 'MALLEY';
PUT SKIP DATA(SURNAME);
PUT SKIP LIST(SURNAME);
SURNAME='O''MALLEY '; <---- Wrong (using PUT SKIP DATA)
SURNAME=O'MALLEY <---- Correct (using PUT SKIP LIST)
SURNAME = 'O''MALLEY';
PUT SKIP DATA(SURNAME);
PUT SKIP LIST(SURNAME);
SURNAME='O''MALLEY '; <---- Wrong (using PUT SKIP DATA)
SURNAME=O'MALLEY <---- Correct (using PUT SKIP LIST)
Thanks,
Misha
"PUT SKIP DATA" and "PUT SKIP LIST"
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: "PUT SKIP DATA" and "PUT SKIP LIST"
According to RTFM, PUT DATA is supposed to show the values in the form they would otherwise be assigned by PL/I statements, in program code.
PUT LIST is supposed to show the values in their finalized form, dedicated to end user.
So, you get exactly what is described in any PL/I manual.
PUT LIST is supposed to show the values in their finalized form, dedicated to end user.
So, you get exactly what is described in any PL/I manual.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 31
- Joined: Fri Nov 27, 2020 12:28 am
- Skillset: REXX,JCL,COBOL,DB2,VSAM
- Referer: Word of mouth
Re: "PUT SKIP DATA" and "PUT SKIP LIST"
Thanks Sergeyken for your response, I was trying to comprehend what you meant. So, was looking for it in PL1 manual but could not find.
However, Just want to elaborate a bit about the source of the Surname field - it comes from a DB2 table where the value is stored as O'Maley
So, if we assign SURNAME='O''Maley' , shouldn't PUT SKIP DATA(SURNAME) give us O'Maley instead of O''MALEY ? because with same value, PUT SKIP LIST(SURNAME) gives us O'Maley
Please if you explain in simpler way, it would be great.
Thanks,
Misha
However, Just want to elaborate a bit about the source of the Surname field - it comes from a DB2 table where the value is stored as O'Maley
So, if we assign SURNAME='O''Maley' , shouldn't PUT SKIP DATA(SURNAME) give us O'Maley instead of O''MALEY ? because with same value, PUT SKIP LIST(SURNAME) gives us O'Maley
Please if you explain in simpler way, it would be great.
Thanks,
Misha
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: "PUT SKIP DATA" and "PUT SKIP LIST"
Frankly, I do not understand, what is not clear in this issue?
Since the data value is always enclosed in quotes then internal quotes MUST BE DOUBLED. Clear as a bell.
List-Directed Output
The LIST option specifies list-directed output.
The PUT LIST statement causes each value specified by the output list to be written to the stream file without the use of a format item. Each value to be output is converted to a character-string value using the normal rules for converting to a character string given in the section Data Type Conversions.
If the original output value is a bit string, the resulting character string is enclosed in quotation marks and a B is appended to its right end.
With PUT LIST and PUT DATA, if a variable of type AREA or a structure containing elements of type AREA is used as an argument, <...> is output as its contents. This is because the actual contents of the contents of AREA in these cases is not readable.
Data-Directed Output
The DATA option specifies data-directed output.
The PUT DATA statement is equivalent to the PUT LIST statement, with the following differences:
An output-list item can be a scalar, element, array, or structure reference, not an expression. The reference may contain structure qualifiers and subscripts, but may not be locator qualified.
The dataname of each reference is written along with the value. This is done in the form dataname=value. If the value is an array, each element is written with its array name and the actual value of its subscript(s). If the value is a structure, each elementary member is written with its dataname fully qualified and with all subscripts at the end.
The dataname=value combinations are separated by spaces except when writing to a PRINT file, when each such item will be aligned on a TAB stop. A semicolon is written following the last value.
The data values are written, in most cases, just as they are in PUT LIST. However, for character data, the data value is always enclosed in quotes when it is written out.
A based variable in the output-list must be declared with an explicit pointer.
Since the data value is always enclosed in quotes then internal quotes MUST BE DOUBLED. Clear as a bell.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 31
- Joined: Fri Nov 27, 2020 12:28 am
- Skillset: REXX,JCL,COBOL,DB2,VSAM
- Referer: Word of mouth
Re: "PUT SKIP DATA" and "PUT SKIP LIST"
Thanks a lot Sergeyken for all these details !! Understood 

-
- Similar Topics
- Replies
- Views
- Last post
-
-
Skip last 3 bytes and first 3 bytes of data in cobol
by senthamizh » Wed Dec 21, 2022 7:26 pm » in IBM Cobol - 2
- 1793
-
by Robert Sample
View the latest post
Thu Dec 22, 2022 9:18 am
-
-
- 23
- 8093
-
by Devrana
View the latest post
Wed Jul 27, 2022 5:30 pm
-
- 0
- 1193
-
by stel
View the latest post
Wed Sep 21, 2022 1:06 pm
-
-
List all ControlM Conditions generic in a rexx
by jobschubse » Tue May 18, 2021 6:05 pm » in All Other Tools - 2
- 3732
-
by jobschubse
View the latest post
Wed May 19, 2021 11:29 am
-
-
- 3
- 6850
-
by socker_dad
View the latest post
Wed May 04, 2022 12:59 am