Desktop productivity for business analysts and programmers

Reading Mainframe file in DI Studio in UNIX

Reply
Occasional Contributor
Posts: 14

Reading Mainframe file in DI Studio in UNIX

I have a mainframe file as in the example below:
123-4567890-12;2009-07-26;2009-07-26;
123-0987654-32;2010-08-30;
234-5678901-23;2009-03-31;2009-12-29
345-6789012-34;2009-05-20;
456-7890123-45;2010-03-20;2009-09-15
567-8901234-56;2009-09-11;
.......
.......
I want to read it in DI Studio in UNIX but I am not getting the correct result. I am using the code as below. Can anyone help on this.

data A;

infile '"/"'
lrecl = 256
firstobs = 1
missover
RECFM = F;

attrib ID length = $14 informat = $ebcdic14.;
attrib DT1 length = $10 informat = $ebcdic10.;
attrib DT2 length = $10 informat = $ebcdic10.;

input @ 1 ID $ebcdic14.
@ 16 DT1 $ebcdic10.
@ 27 DT2 $ebcdic10.;

run;
Super Contributor
Super Contributor
Posts: 3,174

Re: Reading Mainframe file in DI Studio in UNIX

Can you be a bit more specific with the SAS processing behavior/result, than "...but I am not getting the correct result."?? What is SAS generating? And it would be best communicated if you were to capture the SAS-generated log and paste it directly into a post/reply, ideally with a PUTLOG _ALL_ in your code for diagnostic purposes (both your own and for the forum visitors).

Scott Barry
SBBWorks, Inc.
Respected Advisor
Posts: 3,065

Re: Reading Mainframe file in DI Studio in UNIX

There is also the question as to how you transferred your mainframe file to Unix. You should only use EBCDIC informats if the file was transferred in BINARY mode so that the file is still EBCDIC-encoded. If the file was transferred as TEXT then the translation to ASCII would have happened automatically so that you don't require the EBCIDC informats. If your input file just looks like standard text in a Unix text editor its already in ASCII.
Ask a Question
Discussion stats
  • 2 replies
  • 171 views
  • 0 likes
  • 3 in conversation