View previous topic :: View next topic
Author
Message
mike beckmann New User Joined: 21 Apr 2009Posts: 9 Location: Cedar Rapids Iowa
I have a VB file that can have a string I need to find in any position. Once I find it, I need to have it and the next 18 positions displayed in the output.
rec length=4504 and I use the following statement to search for the string
INCLUDE COND=(5,4499,SS,EQ,C'113A025')
but do not know how to include the next 18 characters after the string in my output file.
here is the entire code:
Code:
//RUNSORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=infile,DISP=SHR
//SORTOF00 DD DSN=outputfile,
// DISP=(,CATLG,CATLG),
// SPACE=(CYL,(10,10),RLSE)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(5,4499,SS,EQ,C'113A025')
OUTFIL FILES=00,VTOF,
OUTREC=(5,4499)
Back to top
saiprasadh Active User Joined: 20 Sep 2006Posts: 154 Location: US
Hi Mike,
i used below mentioned SORTCARD for Fixed Length Input file.
Code
Code:
//VSEKARS6 JOB (ACCOUNT),'VSEKARS',MSGCLASS=X,
// CLASS=A,NOTIFY=VSEKARS
//*
//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=VSEKARS.SAI.TEST,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'113A025'),
PARSE=(%01=(STARTAFT=C'113A025',FIXLEN=18)),
BUILD=(1:%01,80:X)),
IFTHEN=(WHEN=(1,80,SS,NE,C'113A025'),
BUILD=(80:X))
OUTFIL FNAMES=SORTOUT,REMOVECC,
INCLUDE=(1,80,CH,GT,C' ')
/*
Input:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
MYSAI113A02512345678901234567890
113A025SAI45678901234567890
TEST
SAITEST
Output:
Code:
123456789012345678
SAI456789012345678
Back to top
mike beckmann New User Joined: 21 Apr 2009Posts: 9 Location: Cedar Rapids Iowa
saiprasadh,
Thank you very much for such a timely response - worked great!
Back to top
Please enable JavaScript!