Jumbled data in some rows - z/OS to Unix

Accepted Solution Solved
Reply
Regular Contributor
Posts: 161
Accepted Solution

Jumbled data in some rows - z/OS to Unix

Hello,

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.

 


jumbled data.PNG
Kannan Deivasigamani

Accepted Solutions
Solution
‎02-27-2016 04:04 AM
Super User
Posts: 9,662

Re: Jumbled data in some rows - z/OS to Unix

[ Edited ]

Check these three options may give you some help :

infile 'xx' encoding='wlatin1' termstr=cr recfm=s370vb;

 

View solution in original post


All Replies
Super User
Posts: 5,254

Re: Jumbled data in some rows - z/OS to Unix

Just to be clear: so you transfer external files or SAS data sets? And what transfer mechanism so you use; ftp, SAS/CONNECT...?
Data never sleeps
Super User
Posts: 6,928

Re: Jumbled data in some rows - z/OS to Unix

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎02-27-2016 04:04 AM
Super User
Posts: 9,662

Re: Jumbled data in some rows - z/OS to Unix

[ Edited ]

Check these three options may give you some help :

infile 'xx' encoding='wlatin1' termstr=cr recfm=s370vb;

 

Super User
Posts: 6,928

Re: Jumbled data in some rows - z/OS to Unix

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).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Regular Contributor
Posts: 161

Re: Jumbled data in some rows - z/OS to Unix

@KurtBremser, @Ksharp, @LinusH - Thanks for all your responses.  Here are more details of the problem.......

 

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.


Sample - data shift.PNG
Kannan Deivasigamani
Regular Contributor
Posts: 161

Re: Jumbled data in some rows - z/OS to Unix

[ Edited ]

@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;

Kannan Deivasigamani
Super User
Posts: 6,928

Re: Jumbled data in some rows - z/OS to Unix

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Regular Contributor
Posts: 161

Re: Jumbled data in some rows - z/OS to Unix

I'm curious now.
1) Do u have any comp fields ?
2) Do u have carriage return linefeed chars on your recs on the mainframe?
Kannan Deivasigamani
☑ This topic is SOLVED.

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

Discussion stats
  • 8 replies
  • 554 views
  • 0 likes
  • 4 in conversation