MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting all the records after the Key ? (ICETOOL)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Wed Mar 17, 2004 1:59 pm    Post subject: Getting all the records after the Key ? (ICETOOL) Reply with quote

Hi

Is there any way to get all the records after a specified string?
For Example , If I have input file as,

PROCESSED A RECS
READ COMPLETED BYPASSED
--------- --------- --------
00464251 00463128 00001123

PROCESSED B RECS
READ COMPLETED BYPASSED
--------- --------- --------
00666251 00666128 00000123
...
...
...
..

My output should be all the records after
Quote:
PROCESSED B RECS
,

READ COMPLETED BYPASSED
--------- --------- --------
00666251 00666128 00000123
...
...
...
..

From the output i can drive the original requirement output by outrec and a binay addition. ,

Quote:
My original requirement output is,
00666251 00666128 00000123


Cheers,
Subra

[/quote]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 17, 2004 2:28 pm    Post subject: Reply with quote

Subra,

The following DFSORT/ICETOOL JCl will give you the desired results.If you have syncsort at your shop then change the pgm name to synctool. I assumed that your input file is 80 bytes in length and is of FB Recfm.

A brief explanation of the job. We first add a seqnum to the input using seqnum, starting with a value of 2 as we want all the records after the specified string.

Now we include only the records which has 'PROCESSED B RECS' and we use the seqnum to generate a dynamic control card which actually writes all the records found after the desired string.
Code:

//STEP0100  EXEC  PGM=ICETOOL                                 
//TOOLMSG   DD SYSOUT=*                                       
//DFSMSG    DD SYSOUT=*                                       
//IN        DD *                                             
PROCESSED A RECS                                             
READ COMPLETED BYPASSED                                       
--------- --------- --------                                 
00464251 00463128 00001123                                   
PROCESSED B RECS                                             
READ COMPLETED BYPASSED                                       
--------- --------- --------                                 
00666251 00666128 00000123                                   
...                                                           
...                                                           
...                                                           
..                                                           
//OUT       DD SYSOUT=*                                       
//TOOLIN    DD *                                             
  COPY FROM(IN) USING(CTL1)                                   
  COPY FROM(IN) USING(CTL2)                                   
//CTL1CNTL  DD *                                             
  INREC FIELDS=(1,80,SEQNUM,8,ZD,START=2)                     
  OUTFIL FNAMES=CTL2CNTL,                                     
  INCLUDE=(1,16,CH,EQ,C'PROCESSED B RECS'),                   
  OUTREC=(C' OUTFIL FNAMES=OUT,STARTREC=',81,8,80:X)         
//CTL2CNTL  DD DSN=&C1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)   
/*


The output from this step is:
Code:

READ COMPLETED BYPASSED                       
--------- --------- --------                 
00666251 00666128 00000123                   
...                                           
...                                           
...                                           
..                                           



If your final requirement is only to get one line of the counts , then change the ctl1cntl control to the following.

Code:

//CTL1CNTL  DD *                                                       
  INREC FIELDS=(1,80,SEQNUM,8,ZD,START=4)                             
  OUTFIL FNAMES=CTL2CNTL,                                             
  INCLUDE=(1,16,CH,EQ,C'PROCESSED B RECS'),                           
  OUTREC=(C' OUTFIL FNAMES=OUT,STARTREC=',81,8,C',ENDREC=',81,8,80:X) 


The output with the above control cards is as follows.
Code:

00666251 00666128 00000123 



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Wed Mar 17, 2004 3:25 pm    Post subject: Reply with quote

Kolusu,

Great.. A quick solution saves me to write a new program ..

Thanks for the timely help ..

Cheers,
Subra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group