To retrieve the output like this using SORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

To retrieve the output like this using SORT

Postby Daouchiche » Thu Jul 24, 2014 11:25 pm

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
Daouchiche
 
Posts: 17
Joined: Thu Jul 24, 2014 9:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need Help thank

Postby BillyBoyo » Fri Jul 25, 2014 12:04 am

Probably. If you can uniquely identify what you want, or what you don't want, you can use INCLUDE COND= or OMIT COND=.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need Help thank

Postby Daouchiche » Fri Jul 25, 2014 12:34 am

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 :
..}.....126061
Daouchiche
 
Posts: 17
Joined: Thu Jul 24, 2014 9:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need Help thank

Postby BillyBoyo » Fri Jul 25, 2014 4:17 am

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: To retrieve the output like this using SORT

Postby Daouchiche » Fri Jul 25, 2014 10:08 pm

The second record is begin with X'0001D02E'
Daouchiche
 
Posts: 17
Joined: Thu Jul 24, 2014 9:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To retrieve the output like this using SORT

Postby BillyBoyo » Fri Jul 25, 2014 11:09 pm

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')
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: To retrieve the output like this using SORT

Postby NicC » Sun Jul 27, 2014 1:45 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: To retrieve the output like this using SORT

Postby Daouchiche » Sun Jul 27, 2014 6:59 pm

Thanks Nic
Daouchiche
 
Posts: 17
Joined: Thu Jul 24, 2014 9:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To retrieve the output like this using SORT

Postby Daouchiche » Mon Jul 28, 2014 8:56 pm

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
Daouchiche
 
Posts: 17
Joined: Thu Jul 24, 2014 9:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To retrieve the output like this using SORT

Postby BillyBoyo » Mon Jul 28, 2014 9:28 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post