02-26-2016 01:51 AM
I transferred a file with comp values as binary and seems like once every bunch of records a record is jumbled and messes up the read while others are clean and read without a problem on Unix SAS. Is there a reason it would appear so?
var1 s370fpib4. var2 $ebcdic14. var3 $ebcdic10. var4 $ebcdic1.
and the data appears like below:
I tried with different possible combinations and the data seems to be read with no problem on the mainframe but when brought to Unix has this issue.
Any advice is welcome and appreciated.
Thanks in advance.
02-26-2016 02:29 AM
You do seem to read a z/OS flat file on UNIX.
Make sure that the file is transferred binary, if using an external tool.
Use RECFM=F and the correct LRECL in the INFILE (or FILENAME, if using filename ftp) statement. If the file was originally stored as VB, further problems may arise.
If these tips don't provide enough help, describe your complete process and supply the whole data step code and log of that data step
02-26-2016 03:43 AM
When you have a binary stored value in a file, you can't rely on termstrings as record separators, as some binary values will spoof them.
With binary values, you either need fixed length records or a leading RDW for every record (which is necessary when you use recfm=s370vb).
02-26-2016 08:30 AM
The file on the mainframe has the following characteristics
Organization . . . : PS Record format . . . : FB Record length . . . : 74 Block size . . . . : 27972
The mainframe file has the first variable defined as a comp and everything as alphas.
PIC S9(9) USAGE COMP.
The data was transferred using NDM (connect direct) using binary options as shown below:
COPY FROM (PNODE DSN=&INDSN DISP=SHR - SYSOPTS="DATATYPE(BINARY) XLATE(NO)" - ) - COMPRESS EXTENDED - TO (SNODE DSN=&OUTDSN - SYSOPTS="DATATYPE(BINARY)" - )
On SAS EG, I try to read this first comp variable using the special format :s370fpib4.
Here is the shift I see once in a while... which I've shown in the attached screenshot sample.
Hope this gives more clarity.
02-27-2016 04:06 AM - edited 02-27-2016 04:16 AM
@Ksharp I forced a x'0D' to the end of the record on the file from the mainframe and transferred as binary to Unix and then used the option you suggested with a variation termstr=crlf and then it looks beautiful now. Thanks very much.
Thanks to everyone who tried to help.
Here is what I did
(appended a x'0D' to the end of the record on mainframe) //SYSIN DD * SORT FIELDS=COPY OUTREC OVERLAY=(75:X'0D') (transferred thru NDM using following options) SYSOPTS=":DATATYPE=BINARY:STRIP.BLANKS=NO:XLATE=NO:") - TO (SNODE DSN=&OUTDSN DISP=RPL - SYSOPTS=":DATATYPE=TEXT:STRIP.BLANKS=NO:XLATE=NO:") (on EG, read the file using your suggestion) infile in2 termstr=crlf;
02-27-2016 05:42 AM
Since this is a file with record format FB, a simpler way will be to transfer it as is, and then read with recfm=f lrecl=74
This is how we do all our mainframe transfers, works like a charm
Need further help from the community? Please ask a new question.