View previous topic :: View next topic
Author
Message
POOJA KHADE New User Joined: 28 Dec 2006Posts: 15 Location: mumbai
I have the below records in input file
abcd
1 header
efgh
ijk
lmn
opq
5 Trailer
rst
uvw
1 Header
xyz
ght
5 Trailer
reereqwe
fdsr
gresd
hrhfb
gegs
********************EOF****************
I want my out file should contain two blocks starting with 1 till the end 5
that is the output should contain
1 header
efgh
ijk
lmn
opq
5 Trailer
1 Header
xyz
ght
5 Trailer
It should omit the records between two blocks
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),
END=(1,1,CH,EQ,C'5'),PUSH=(81:ID=1))
OUTFIL INCLUDE=(81,1,CH,NE,C' '),BUILD=(1,80)
/*
Back to top
POOJA KHADE New User Joined: 28 Dec 2006Posts: 15 Location: mumbai
Thanks Frank for the quick help...
i tried the same code but it is abending with Syntax error for inrec..
Can you please check it...
Thank you
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
Pooja Khade,
suggest you post the error messages with code tags for Frank.
Possibly you do not have the latest DFSOR PTF. I see that the GROUP keyword is used. could be the problem.
but you have to post the JES output of DFSORT so that he can verify
your version - as well as your copy of the code.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
Possibly you do not have the latest DFSORT PTF. I see that the GROUP keyword is used. could be the problem.
Or perhaps you're not using DFSORT at all. Please do post the //SYSOUT messages.
Back to top
POOJA KHADE New User Joined: 28 Dec 2006Posts: 15 Location: mumbai
IGD103I SMS ALLOCATED TO DDNAME SORTIN
IGD103I SMS ALLOCATED TO DDNAME SORTOUT
IEF237I JES3 ALLOCATED TO SYSIN
IEC130I SORTMSG DD STATEMENT MISSING
WER268A VS90455C,JOBSTEP , -INREC STATEMENT : SYNTAX ERROR
WER211B VS90455C,JOBSTEP , -SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I VS90455C,JOBSTEP , -SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
IEF472I VS90455C JOBSTEP - COMPLETION CODE - SYSTEM=000 USER=0016 REASON=0000000
IEF285I VS90455.VS90455C.JOB38610.D000000A.? SYSOUT
IEF285I VS90455.VS90455C.JOB38610.D000000B.? SYSOUT
IGD104I VS90455.TEST.SORT RETAINED, DDNAME=SORTIN
Back to top
knarayan New User Joined: 25 Nov 2008Posts: 9 Location: providence, ri
that is syncsort.. not sure if syncsort supports the when=group
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
The current release of Syncsort supports WHEN=GROUP. . .
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Hello,
You might want to try this if you dont have the latest version installed.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= input file (FB/LRECL=80)
//SORTOUT DD DSN= output file (FB/LRECL=80)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),
OVERLAY=(81:SEQNUM,8,ZD,INCR=2)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'5'),
OVERLAY=(81:SEQNUM,8,ZD,INCR=2)),
IFTHEN=(WHEN=NONE,
OVERLAY=(89:SEQNUM,8,ZD,81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8)
OUTREC OVERLAY=(89:81,8,ZD,MOD,+2,M11,LENGTH=8)
OUTFIL BUILD=(1,80),OMIT=(89,8,ZD,EQ,0)
Back to top
Please enable JavaScript!