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 

Copy records between two alphanumeric values ?

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


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Jan 21, 2009 12:25 pm    Post subject: Copy records between two alphanumeric values ? Reply with quote

Hi,

Our input files are like this.......

Input-1: (RECFM=FB, LRECL=90)
Code:

----+----1----+
9TJX10IR VOLUME   
9TJX1013IMP   2008
9TJX10MOTOR, INC.
1GJX05IR VOLUME   
1GJX0513IMP   2009
1GJX05TEEAY, INC.
2GJX09IR VOLUME   
2GJX0913IMP   2007
2GJX09TEEAY, INC.
0GJX12IR VOLUME   
0GJX1213IMP   2009
0GJX12TEEAY, INC.
0SJX00IR VOLUME   
0SJX0013IRS   2008
0SJX00VETER, INC.


Input-2: (RECFM=FB, LRECL=80)
Code:

X00 X10


Need to copy records from file input-1 if 4th to 6th position of input-1 is in the range of values given in input-2. Range starting value is X00 and range ending value is X10 (both inclusive).

Expected output:
Code:

0SJX00IR VOLUME   
0SJX0013IRS   2008
0SJX00VETER, INC.
1GJX05IR VOLUME   
1GJX0513IMP   2009
1GJX05TEEAY, INC.
2GJX09IR VOLUME   
2GJX0913IMP   2009
2GJX09TEEAY, INC.
9TJX10IR VOLUME   
9TJX1013IMP   2008
9TJX10MOTOR, INC.


Please help.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jan 21, 2009 1:06 pm    Post subject: Reply with quote

mf_user,

You can use DFSORT symbols to get the desired results. You say copy but you actually are sorting the data. Change the sort card in step0200 to your desired sorting condition.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
X00 X10                                                     
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE) 
//SYSIN    DD *                                             
  OPTION COPY,STOPAFT=1                                     
  OUTFIL BUILD=(C'MINKEY,C''',1,3,C'''',/,                 
                C'MAXKEY,C''',5,3,C'''',80:X)               
//*                                                         
//STEP0200 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&T1,DISP=SHR                             
//SORTIN   DD *                                             
9TJX10IR VOLUME                                             
9TJX1013IMP   2008                                         
9TJX10MOTOR, INC.                                           
1GJX05IR VOLUME                                             
1GJX0513IMP   2009                                         
1GJX05TEEAY, INC.                                           
2GJX09IR VOLUME                                             
2GJX0913IMP   2007                                         
2GJX09TEEAY, INC.                                           
0GJX12IR VOLUME                                             
0GJX1213IMP   2009                                         
0GJX12TEEAY, INC.                                           
0SJX00IR VOLUME                                             
0SJX0013IRS   2008                                         
0SJX00VETER, INC.                                           
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=(1,1,CH,A)
  INCLUDE COND=(4,3,CH,GE,MINKEY,AND,4,3,CH,LE,MAXKEY)     
//*

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


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Jan 22, 2009 4:14 am    Post subject: Reply with quote

Kolusu, Thanks a lot. Yes. I wanted to have a SORTED output file.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
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 -> 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