Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Since it's a VB record, we need to know what a blank record will look like. Will it be a 5-byte record with one blank data byte, or could it have more than one blank data byte? If it can have any number of blank data bytes, that will complicate things.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Ok, that makes things easier.
With z/OS DFSORT V1R5 PTF UK90013 (July, 2008) you can use this DFSORT/ICETOOL job. If you don't have this PTF installed, ask your System Programmer to install it. Alternatively, use the second more complex job shown below.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (VB/454)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//*** Use MOD for //OUT
//OUT DD DISP=MOD, DSN=... MOD output file (VB/454)
//TOOLIN DD *
* Write n-1 records to MOD //OUT data set.
* Write last record to //T1 data set.
SUBSET FROM(IN) TO(OUT) INPUT REMOVE LAST DISCARD(T1)
* Write last record to MOD //OUT data set if it's not blank
COPY FROM(T1) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
OPTION VLSCMP
* Don't copy the last record to //OUT if it has 450 blanks.
OUTFIL FNAMES=OUT,
INCLUDE=(1,2,BI,NE,454,OR,5,450,SS,NE,C' ')
/*
If you can't use SUBSET, you can use this more complex multistep DFSORT job. Use your input file in all three steps. Use your output file in steps 2 (NEW) and 3 (MOD).