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

Hello Community,


we need to import a TSO data file with packed fields. It is located on a host with OS390. We transfer it per ftp to the SAS server (with UNIX OS).

This is my current routine to import the files:

%let PFAD_BILANZWERTE = "/appdata/sas/fb_daten/vrm/lp/lf/inte/BIL_032015.bin";

data BILGEWZER;  

infile &PFAD_BILANZWERTE.          

encoding="ebcdic500"       

lrecl=1152          

recfm=F          

blksize=27648;   

input          

MONAT                                    S370FIBU2.

VSNR                                       $EBCDIC11.

@22        AENDDAT                 $EBCDIC10.

@32        AENDGRU                $EBCDIC4.

@38        AENDBUCH_HHJJ   $EBCDIC4.

@42        AENDBUCH_MM     $EBCDIC2.

@48        MVANT                     S370FPD5.6

@89        BGKZ                        $EBCDIC3.

@230      DRZ                          S370FPD8.2

@238      DRP                          S370FPD8.2

@246      DRA                          S370FPD8.2

@931      VTID                          S370FPD3.;

run;

I would like to optimize this routine. My preferred solution would be to supply the COBOL copy member of this file to SAS such that SAS knows where the fields start, end and which format they are on its own. Is this possible?

Has anyone experience with such files?

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
tlk
Quartz | Level 8 tlk
Quartz | Level 8

There was a macro to do this  http://ftp.sas.com/techsup/download/technote/ts620.html , it dates to version 8 but it should work.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

You would need to write a data step that reads the COBOL definitions, and generates the input statement from that.

This data step could either write an external file that you later use with %include, or generate the data step to read the TSO file by using call execute.

Since you use FTP, you could also read the file directly from the z/OS mainframe with filename ftp. Saves the external FTP transfer and the disk space needed for the transferred file.

tlk
Quartz | Level 8 tlk
Quartz | Level 8

There was a macro to do this  http://ftp.sas.com/techsup/download/technote/ts620.html , it dates to version 8 but it should work.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1855 views
  • 4 likes
  • 3 in conversation