LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 1996, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Aug 1996 16:01:40 -0400
Reply-To:     Roger Deangelis <deangel@HORIZSYS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Roger Deangelis <deangel@HORIZSYS.COM>
Subject:      Reading IBM Standard Labels in Unix

The following code will read IBM standard labels and interfile labels and create global macro vars with Volser, Recfm, Lrecl, Blksize, Dataset name and time of creation. The log is also included.

%macro utlvlck ( udev=/dev/rmt/1, /* tape drive */ /* label file number */ ufile=1 ) / des="Check IBM Standard Label";

/*-------------------------------------------------*\ | | | UNIS Sun Solaris 2.5 SAS 611 | | | | Read volume and interfile labels for IBM | | standard labeled tapes | | | |===================================================| | | | IPO | | | | Inputs | | ====== | | | | udev = tape device | | | | ufile = 1 / 4 label second file / 7 3rd file | | | | If mutilple files (ie 2 files) | | | | File# | | 1 - Standard Label | | 2 - Data | | 3 - Trailer | | 4 - Label for second file | | 5 - Data | | 6 - Trailer | | | | | | Process - Read standard label - 1st file | | ======= and interfile labels. | | Buil macro vars | | | | Output | | ===== | | Global macro vars | | | | utlvlckv - volume | | utlvlckt - time | | utlvlckr - recfm | | utlvlckl - lrecl | | utlvlckb - blocksize | | utlvlckd - dataset name | | | | | \*-------------------------------------------------*/

%global utlvlckv utlvlckf utlvlckb utlvlckl utlvlckd;

/*-------------------------------------------------*\ | | | COPYRIGHT 1996 BY | | | | COMPUCRAFT, INC | | 49 SPACKENKILL RD | | POUGHKEEPSIE, NEW YORK 12603 | | | | Code by Roger DeAngelis | | Users are free to do what these please with code | \*-------------------------------------------------*/

/*-------------------------------------------------*\ | Rewind tape - should make this a cross platform | | macro call. | \*-------------------------------------------------*/

x "mt -f &udev rew";

/*-------------------------------------------------*\ | Forward space files for interfile labels | \*-------------------------------------------------*/

%if &ufile ne 1 %then

%do;

%do i = 1 %to %eval(&ufile-2);

x "mt -f &udev.n fsf";

%end;

%end;

filename uin tape "&udev" lrecl=80 blksize=80 recfm=f;

/*-------------------------------------------------*\ | Parse standard label or interfile labels | \*-------------------------------------------------*/

data _null_;

infile uin;

/*-------------------------------------------------*\ | First file Standard Label IBM | \*-------------------------------------------------*/

%if &ufile eq 1 %then

%do;

input @5 vol $ebcdic6. / @5 dsn $ebcdic17. @43 dte s370fzd5. / @5 recfm $ebcdic1. @6 blksz $ebcdic5. @11 lrecl $ebcdic5. ;

%end;

/*-------------------------------------------------*\ | Interfile Labels | \*-------------------------------------------------*/

%else

%do;

input @22 vol $ebcdic6. @5 dsn $ebcdic17. @43 dte s370fzd5. / @5 recfm $ebcdic1. @6 blksz $ebcdic5. @11 lrecl $ebcdic5.;

%end;

date=put(datejul(dte),date7.);

call symput('utlvlckv',vol); call symput('utlvlckt',date); call symput('utlvlckr',recfm); call symput('utlvlckl',lrecl); call symput('utlvlckb',blksz); call symput('utlvlckd',dsn);

put vol= dsn= recfm= blksz= lrecl= dte=;

stop;

run;

%put utlvlckv=&utlvlckv utlvlckt=&utlvlckt utlvlckr=&utlvlckr utlvlckl=&utlvlckl utlvlckb=&utlvlckb utlvlckd=&utlvlckd ;

%mend utlvlck;

%utlvlck;

NOTE: The infile UIN is: File Name=/dev/rmt/1

VOL=OCCOB2 DSN=.COB2SAS.PROGRAMS RECFM=V BLKSZ=06180 LRECL=06176 DTE=90211 NOTE: 3 records were read from the infile UIN. NOTE: DATA statement used: time: memory: real 6.316 seconds page faults 23 user cpu 0.144 seconds page reclaims 0 system cpu 0.260 seconds usage 33 K block I/O operations: context switches: input 1 voluntary 114 output 6 involuntary 18

MLOGIC(UTLVLCK): %PUT utlvlckv=&utlvlckv utlvlckt=&utlvlckt utlvlckr=&utlvlckr utlvlckl=&utlvlckl utlvlckb=&utlvlckb utlvlckd=&utlvlckd SYMBOLGEN: Macro variable UTLVLCKV resolves to OCCOB2 SYMBOLGEN: Macro variable UTLVLCKT resolves to 30JUL90 SYMBOLGEN: Macro variable UTLVLCKR resolves to V SYMBOLGEN: Macro variable UTLVLCKL resolves to 06176 SYMBOLGEN: Macro variable UTLVLCKB resolves to 06180 SYMBOLGEN: Macro variable UTLVLCKD resolves to .COB2SAS.PROGRAMS utlvlckv=OCCOB2 utlvlckt=30JUL90 utlvlckr=V utlvlckl=06176 utlvlckb=06180 utlvlckd=.COB2SAS.PROGRAMS MLOGIC(UTLVLCK): Ending execution.


Back to: Top of message | Previous page | Main SAS-L page