Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Group extract of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Thu Feb 03, 2011 3:51 pm    Post subject: Group extract of records
Reply with quote

I have a fixed block dataset whose LRECL is 8.
I want to extract the record, and its subsequent records, if the record start with 'D' and a 'A' is present in the fifth column till another 'D' is found in the first position. For an example, if the data is present as below
the output would contain all the records with fonts RED

Input
D2222222
11111111
55555555
77777777
D111A000
00000000
AAAAAAAA
AAA BBBB
D222A000
AA177676
KKKKKKKK
012LLLLL

D2622222
11111111
55555555
77777777
D111A000
KKKKKK00
AAAAAAAA
AAA BBBB


Output

D111A000
00000000
AAAAAAAA
AAA BBBB
D222A000
AA177676
KKKKKKKK
012LLLLL
D111A000
KKKKKK00
AAAAAAAA
AAA BBBB
Back to top
View user's profile Send private message

Guest







PostPosted: Thu Feb 03, 2011 4:41 pm    Post subject:
Reply with quote

Hi Suzeet,
You can use the following JCL for your requirement:
Code:

//STEP010  EXEC PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                           
//DFSMSG DD SYSOUT=*                                             
//IN DD *                                                       
D2222222                                                         
11111111                                                         
55555555                                                         
77777777                                                         
D111A000                                                         
00000000                                                         
AAAAAAAA                                                         
AAA BBBB                                                         
D222A000                                                         
AA177676                                                         
KKKKKKKK                                                         
012LLLLL                                                         
D2622222                                                         
11111111                                                         
55555555                                                         
77777777                                                         
D111A000                                                         
KKKKKK00                                                         
AAAAAAAA                                                         
AAA BBBB                                                         
/*                                                               
//OUT DD SYSOUT=*                                               
//TOOLIN DD *                                                   
COPY FROM(IN) TO(OUT) USING(CTL1)                               
/*                                                               
//CTL1CNTL DD *                                                 
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'D'),PUSH=(10:1,8))
  OUTFIL FNAMES=OUT,INCLUDE(10,1,CH,EQ,C'D',AND,14,1,CH,EQ,C'A')
/*


Kindly get back to me in case of any concern.

devil13
There is always a better solution.
Back to top
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Feb 03, 2011 11:03 pm    Post subject:
Reply with quote

devil13 wrote:
Kindly get back to me in case of any concern


Devil13,

You just forgot to trim the pushed value from output. Assuming OP needs only the first 9 bytes. He needs to use the BUILD statement on the outfil as follows.

Code:

 OUTFIL FNAMES=OUT,BUILD=(1,9),                 
 INCLUDE(10,1,CH,EQ,C'D',AND,14,1,CH,EQ,C'A')   
Back to top
View user's profile Send private message
Guest







PostPosted: Fri Feb 04, 2011 8:39 am    Post subject:
Reply with quote

Hi,
Thanks Skolusu.

Actualy I thought it would show him the procedure and that would be helpful icon_smile.gif
But definitely I missed to mention the build=(1,9)

devil13
I am learning cos you guys are helping a lot.
Back to top
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Feb 04, 2011 11:59 am    Post subject: Reply to: Group extract
Reply with quote

Thanks. It works like a charm
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us