IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Group extract of records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top