Hello again,
I'm given a file that was sourced from mainframe but now is with me on Unix as a .txt file. There are some numeric variables stored in 4 bytes that were defined on the mainframe as 9(7) Comp-3 types in the corresponding Cobol copybook. I tried reading in a mainframe SAS pgm, a copy of this file available on the mainframe as PD4. and works fine. I ran the same code in Unix SAS but displays as "." so I tried reading with S370FPD4., PD4. , PK4 but no luck. any clue of what might be happening.
fyi - I am able to read the vars before and after this date vars with no issues. Should I be reading this in a different way ?
Thanks in advance.
This SAS note will help:
http://support.sas.com/kb/56/654.html
Also to use S370 informats the data file must be copied from the mainframe to Unix using a BINARY transfer (no conversion from EBCDIC to ASCII). If the text fields contain readable letters (ABC) then the file was not copied in BINARY format.
in the first record, the data starting from 840 till 1881 is read as chars. The next 4 bytes starting with C followed by gibberish chars form the first comp-3 field followed by a 2 byte number followed by 2 more comp fields. The actual value of the first comp field is 1151123. Hope I'm clear. Thanks for looking into this.
Sorry...what should it look like.
I'm not that familiar with these types of things, but my guess is you may also need to change the encoding.
I could entirely incorrect though.
This SAS note will help:
http://support.sas.com/kb/56/654.html
Also to use S370 informats the data file must be copied from the mainframe to Unix using a BINARY transfer (no conversion from EBCDIC to ASCII). If the text fields contain readable letters (ABC) then the file was not copied in BINARY format.
Thanks @SASKiwi. You were absolutely correct.
I had to use SYSOPTS=":DATATYPE=BINARY:XLATE=NO" from Z/OS and on the Unix/receiving end, I used SYSOPTS=":XLATE=NO:" to transfer the data so the packed values are not disturbed in cross-platform transfer. The team sending this file wanted to use NDM hence I had to limit myself to test with it.
One thing I noticed was that, even values that were read as a character on Z/OS as $3. or $10. were transformed and ended up reading with S370FZn. format and $EBCDICn. format for a alpha value. It was fun hunting down those NDM options and formats.
I just wanted to give an update. Thx.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.