Posted: Fri Feb 07, 2003 7:44 am Post subject: How to Sort Variable Block to Fixed Block file
Here is my problem...
MY INPUT FILE IS OF VARIABLE RECORD LENGTH. I WANT TO CREATE A FILE BASED ON THE FOLLOWING CONDITIONS:
1.IT SHOULD BE A FIXED RECORD LENGTH FILE.
2.IT SHOULD CONTAIN ONLY 2 FILEDS FROM THE INPUT FILE,
1ST FIELD FROM POSITION 5 TO 7,
2ND FIELD FROM POSITION 61 TO 63.
3.IT SHOULD BE SORTED IN ASCENDING ORDER BASED ON THE 5TH TO 7TH POSITION OF THE INPUT FILE.
3.IT SHOULD OMIT A RECORD IF THE 5TH TO 7TH POSITION OF THE INPUT RECORD IS EQUAL TO '3DT'.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 07, 2003 8:13 am Post subject:
Rchilla,
Since the input file is a variable file the actual data starts in position 5 ( the first 4 bytes is RDW).so accordingly your sort fields will now change.So your fields in question actually start at 9 and 65 bytes respectively
Code:
//STEP0100 EXEC PGM=SORT
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT VBFILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FBFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=(9,3,CH,A)
OUTFIL CONVERT,OMIT=(9,3,CH,EQ,C'3DT'),
OUTREC=(9,3, $ FLD1 STARTS AT 9 & LENGTH OF 3
65,3, $ FLD2 STARTS AT 65 & LENGTH OF 3
80:x) $ Pad with spaces for the rest of 74 bytes
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum