DATA Step, Macro, Functions and more

9(7) Comp-3 read into S370FPD4.

Accepted Solution Solved
Reply
Regular Contributor
Posts: 161
Accepted Solution

9(7) Comp-3 read into S370FPD4.

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

Accepted Solutions
Solution
‎02-06-2016 12:07 AM
Super User
Posts: 3,252

Re: 9(7) Comp-3 read into S370FPD4.

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


All Replies
Super User
Posts: 19,789

Re: 9(7) Comp-3 read into S370FPD4.

What does it look like in text editor?
Regular Contributor
Posts: 161

Re: 9(7) Comp-3 read into S370FPD4.

[ Edited ]

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
Super User
Posts: 19,789

Re: 9(7) Comp-3 read into S370FPD4.

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. 

Solution
‎02-06-2016 12:07 AM
Super User
Posts: 3,252

Re: 9(7) Comp-3 read into S370FPD4.

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. 

Regular Contributor
Posts: 161

Re: 9(7) Comp-3 read into S370FPD4.

Thanks @SASKiwi. You were absolutely correct. 

 

I had to use SYSOPTS="Smiley Very HappyATATYPE=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
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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