Page 1 of 2
To retrieve the output like this using SORT
Posted:
Thu Jul 24, 2014 11:25 pm
by Daouchiche
Hi,
I have an input VB file with the following data (the HEX contains ..}..... is X'0001D010' the line ...ʤ.. is as X'0001D02E'
Code:
..}.....783091
...ʤ...°."...}.°...db...q"450
..}.....126061
...ʤ...°.|...®.°.¤.cÂ"...¬603
..}.....881309
...ʤ...°.|...®.°.¤.cÂ"...?
I need to extract only the following records
Code:
..}.....126061
...ʤ...°.|...®.°.¤.cÂ"...¬603
Is it possible to retrieve the output like this using SORT or some other tools ICETOOL
Re: Need Help thank
Posted:
Fri Jul 25, 2014 12:04 am
by BillyBoyo
Probably. If you can uniquely identify what you want, or what you don't want, you can use INCLUDE COND= or OMIT COND=.
Re: Need Help thank
Posted:
Fri Jul 25, 2014 12:34 am
by Daouchiche
Hi Billy,
I did something like :
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=File VB input.........,DISP=SHR
//OUT DD DSN=File VB Output......
// DISP=(NEW,CATLG,CATLG),
// SPACE=(CYL,(60,1),RLSE),UNIT=3390,
// RECFM=VB,LRECL=32756,BLKSIZE=0,DSORG=PS
//*
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
INCLUDE COND=((5,4,BI,EQ,X'0001D010',AND,13,10,CH,EQ,C'126061'))
OPTION STOPAFT=2
The Résult is :
Re: Need Help thank
Posted:
Fri Jul 25, 2014 4:17 am
by BillyBoyo
Well the AND isn't going to work because that value is not on the second record. You need something to identify the second record, or some rule by which it is known that you want it.
Re: To retrieve the output like this using SORT
Posted:
Fri Jul 25, 2014 10:08 pm
by Daouchiche
The second record is begin with X'0001D02E'
Re: To retrieve the output like this using SORT
Posted:
Fri Jul 25, 2014 11:09 pm
by BillyBoyo
So you can specify that:
INCLUDE COND=((5,4,CH,EQ,X'0001D010',
AND,13,10,CH,EQ,C'126061'),
OR,
5,4,CH,EQ,X'0001D02E')
Re: To retrieve the output like this using SORT
Posted:
Sun Jul 27, 2014 1:45 am
by NicC
Daouchiche,
Please post in the correct section - this is not a JCL problem but a sort problem. I have moved it to the correct part of the forum - assuming that you are using DFsort and not Syncsort. Also, please learn how to use the code tags for posting data, code etc. I have done it for you this time.
Re: To retrieve the output like this using SORT
Posted:
Sun Jul 27, 2014 6:59 pm
by Daouchiche
Thanks Nic
Re: To retrieve the output like this using SORT
Posted:
Mon Jul 28, 2014 8:56 pm
by Daouchiche
Hi BillyBoyo
I tried the solution you gave me and thats not working the first condition is not repected. the aim should be as when the first condition is respected (5,4,BI,EQ,X'0001D010',AND,13,10,CH,EQ,C'453091') so verify the row which came just after and print it too. so the result shoud be like :
..}.....126061
...ʤ...°.|...®.°.¤.cÂ"...¬603
Thanks
Re: To retrieve the output like this using SORT
Posted:
Mon Jul 28, 2014 9:28 pm
by BillyBoyo
OK, clearer what you want now.
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,4,X,5)),
IFTHEN=(WHEN=GROUP,BEGIN=(your_condition),
RECORDS=2,
PUSH=(5:2,1))
OUTFIL OMIT=(5,1,CH,EQ,C' '),
BUILD=(1,5,6)
Try something like that.