Hi guys,
Need your assistance with a issue that I have.
I am trying to use EDIT, FTOV & Dictionary items in the same sort, but struggling to put it to work.
I am selecting a couple of fields from the input file.
The first field is 255 bytes long, that I am trying to convert to variable.
The second field is numeric packed. Trying to converted to zone.
also attempting to switch the fields in the output file.
File is sorted by the long field.
I tried moving the EDIT to the input field and still not able to finish.
here are the results.
//SORTOUT DD DSN=NNNN.LLLLL.SUBSET,
// DISP=(NEW,CATLG,DELETE),
// RECFM=VB,LRECL=275,BLKSIZE=0,DSORG=PS,
// UNIT=(SYSALLDA,30),SPACE=(CYL,(30,50),RLSE)
--------------------------------------------------------------------------
INREC FIELDS=(ESRI,TESN) ESROURCE ID & TES NUMBER
SORT FIELDS=(1,255,CH,A)
OUTFIL OUTREC=(5:NTES,EDIT=('IIIIIIIIIIIIT'),18:NESR),
FTOV,VLTRIM=X'40'
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INREC FIELDS=(65,255,679,7)
SORT FIELDS=(1,255,CH,A)
OUTFIL OUTREC=(5:5,7,PD,EDIT=('IIIIIIIIIIIIT'),18:12,255),FTOV,VLTRIM=X'40'
….
WER108I SORTIN : RECFM=FB ; LRECL= 686; BLKSIZE= 27440
WER073I SORTIN : DSNAME=nnnn.mmmm.f7dl
WER257I INREC RECORD LENGTH = 262
WER230A SORTOUT OUTREC FIELD OUTSIDE RANGE
What am I doing wrong?
numeric field grows from 7 PD, to 13, starting at 5 and finishing at 17, right?
and the second field starting at 18 for 255 bytes (max).
what am I missing?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Your input to OUTFIL is 262 bytes long. You are referencing 1,255. Do the maths.
Why are you starting from position 5 for your "number"?
With your INREC FIELDS (please use BUILD) you put 255 bytes from start position 65, then 7 from 679 for your number.
Why are you starting the OUTREC (please, make it BUILD) at position 5? Start it at 1, the default, so you don't have to specify, then start the 255 field just at the next available position.