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!
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.
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.