I have been trying to look for a solution to allow me to append/concatenate the characters "XX" at the end of each record within my VSAM file.
Basically, what I wanted to appear in my output is like this:
INPUT (length 1704, fmt VB):
1 TEST RECORD NUMBER 1
2 TEST REC NUMBER 2
3 TEST RECORD 3
2 TEST REC NUMBER 2
3 TEST RECORD 3
OUTPUT (length 1704, fmt VB):
1 TEST RECORD NUMBER 1XX
2 TEST REC NUMBER 2XX
3 TEST RECORD 3XX
2 TEST REC NUMBER 2XX
3 TEST RECORD 3XX
I tried the OPTION VLSHRT but even with that, I still get the error "ICE218A 3 192 BYTE VARIABLE RECORD IS SHORTER THAN 1702 BYTE MINIMUM FOR SORTOF01 FIELDS"
This is how my SORT step looks like:
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=inputFile.VBFMT,DISP=SHR
//SORTOF01 DD DSN=outputFile,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(100,10),RLSE),
// DCB=(RECFM=VB,LRECL=1704,BLKSIZE=0)
//SYSIN DD *
OPTION VLSHRT
SORT FIELDS=(3,18,CH,A)
OUTFIL FILES=(01),
OUTREC=(1,4,5,1698,C'XX')
/*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=inputFile.VBFMT,DISP=SHR
//SORTOF01 DD DSN=outputFile,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(100,10),RLSE),
// DCB=(RECFM=VB,LRECL=1704,BLKSIZE=0)
//SYSIN DD *
OPTION VLSHRT
SORT FIELDS=(3,18,CH,A)
OUTFIL FILES=(01),
OUTREC=(1,4,5,1698,C'XX')
/*
As much as possible, we wanted to avoid creating a COBOL program only to accomplish the output i described previously. So, I want to know if it is possible to do using only a SORT step in JCL. I hope you could all help me find the easier and less costly solution
![Very Happy :D](https://www.ibmmainframeforum.com/images/smilies/icon_e_biggrin.gif)