Actually, this is a comma separated value (CSV) file. It has fields with variable positions. It might also be a VB file but I'm guessing it's really an FB file.
You can use the following DFSORT job to do what you asked for. However, you'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE and SQZ functions. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
www.ibm.com/servers/storage/support/sof ... /mvs/peug/
If the input file is actually VB, let me know and I'll show you how to change the job to handle that.
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
36,sar,rte,456
45,amb,,698
36,sar,rte,400
45,amb,rte,600
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=5),
%02=(ENDBEFR=C',',FIXLEN=5),
%03=(ENDBEFR=C',',FIXLEN=5),
%04=(FIXLEN=5)),
BUILD=(1:%01,C',',
7:%02,C',',
13:%03,C',',
19:%04,UFF,TO=ZD,LENGTH=5)
SORT FIELDS=(1,5,CH,A,7,5,CH,A,13,5,CH,A)
SUM FIELDS=(19,5,ZD)
OUTREC OVERLAY=(19:19,5,ZD,TO=FS,LENGTH=5,
1:1,23,SQZ=(SHIFT=LEFT))
/*