BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kannand
Lapis Lazuli | Level 10

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. 

 

Kannan Deivasigamani
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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. 

View solution in original post

5 REPLIES 5
Reeza
Super User
What does it look like in text editor?
kannand
Lapis Lazuli | Level 10

20160122_225654-1-1.jpgin 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. 

Kannan Deivasigamani
Reeza
Super User

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. 

SASKiwi
PROC Star

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. 

kannand
Lapis Lazuli | Level 10

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.

Kannan Deivasigamani

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2964 views
  • 1 like
  • 3 in conversation