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 

particular records required

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Fri Jun 09, 2006 4:23 am    Post subject: particular records required Reply with quote

Hi,

I have a file in that around 1.5lac records are there. My requirement is to extract a group of records from that file. the records are as below.

0f--header record.
:
:
:
1JEMPRSBLKEM650XE03XFIST1C
1TAN651NCE423
1TAN652NCE423
1TAPE01NCE423
1TAR078NCE423
1TAR078NCE423
1TAR080NCE423
1TAR100NCE423
1TARB49NCE423
1TARB49NCE423
1TAT136NCE423
1TAT143NCE423
1TAT151NCE423
1TAT159NCE423
1TAT159NCE423
1JEMPRSBLKEM650XE04XFIST1C
:
:

from this data i want the records only with E03 (which is in bold) and the below records till E04. the records are around 82000. pls suggest me the solution.

Thanks
nadh
Back to top
View user's profile Send private message Send e-mail
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Jun 09, 2006 5:00 am    Post subject: Reply with quote

Nadh,

Try this code if my understanding of your input records is correct:
Code:

//STEP010  EXEC PGM=SORT                       
//SORTIN   DD DSN=SHEKAR.TEST.IN,DISP=SHR     
//OUT      DD DSN=SHEKAR.TEST.OUT,DISP=SHR 
//SYSPRINT DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                               
  OPTION COPY                                 
  OUTFIL FNAMES=OUT,INCLUDE=(17,3,CH,EQ,C'E03')
/*                                             
//   

SHEKAR.TEST.IN
Code:

----+----1----+----2----+----3
1                         
2                         
1JEMPRSBLKEM650XE03XFIST1C
1TAN651NCE423   E03       
1TAN652NCE423   E03       
1TAPE01NCE423   E03       
1TAR078NCE423   E03       
1TAR078NCE423   E03       
1TAR080NCE423   E03       
1TAR100NCE423   E03       
1TARB49NCE423   E03       
1TARB49NCE423   E03       
1TAT136NCE423   E03       
1TAT143NCE423   E03       
1JEMPRSBLKEM650XE04XFIST1C
3                   
4             

SHEKAR.TEST.OUT
Code:

----+----1----+----2----+----3
1JEMPRSBLKEM650XE03XFIST1C     
1TAN651NCE423   E03           
1TAN652NCE423   E03           
1TAPE01NCE423   E03           
1TAR078NCE423   E03           
1TAR078NCE423   E03           
1TAR080NCE423   E03           
1TAR100NCE423   E03           
1TARB49NCE423   E03           
1TARB49NCE423   E03           
1TAT136NCE423   E03           
1TAT143NCE423   E03   

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Fri Jun 09, 2006 5:42 am    Post subject: Reply with quote

Shekar,

In input file E03 will be in only one record. I want that record plus all the records under it till next E04 record. I think you have understood that every record contains E03, but only header record contains E03. and next header record contains E04. I want to extract all the records between E03 plus E03 record(header) into new file.

ThanQ
nadh
Back to top
View user's profile Send private message Send e-mail
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Fri Jun 09, 2006 6:01 am    Post subject: Reply with quote

Shekar,

I got it. I used repro command of idcams,
REPRO -
INFILE(INFILE) -
OUTFILE(OUTFILE) -
SKIP(40000) -
COUNT(82000)

I got the solution using above commands in jcl.

ThanQ
nadh

Cheers!!!
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jun 09, 2006 10:08 am    Post subject: Reply with quote

nadh,

Are the relative record numbers of the E03 and E04 records always the same or will they change from run to run? If they're always the same, then hardcoding the SKIP and COUNT values would make sense. But if they're not always the same, I would think you'd want a solution that finds the first E03 record wherever it is and then copies the records up to but not including the E04 record. If that's what you want, the "Include or omit groups of records" Smart DFSORT Trick shows a way to do that kind of thing. See:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Mon Sep 04, 2006 11:45 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Tue Jun 20, 2006 7:16 am    Post subject: Reply with quote

Frank,

That's exactly my requirement. Thank you very much.

Cheers!!!

Nadh.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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