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 data until condition is met

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


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Mon Jun 20, 2011 10:17 am    Post subject: copy data until condition is met Reply with quote

Hi, is there a utility that will copy data until a certain condition is met on the input file, then stop copying ?

Example:

Code:
input:
a
b
c
e
f

copy until byte 1 = 'c'

output:

a
b
c
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jun 20, 2011 10:25 am    Post subject: Reply with quote

tcurrier,

Use the following DFSORT JCL. I assumed that LRECL=80 and RECFM=FB

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
A                                                               
B                                                               
C                                                               
E                                                               
F                                                               
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  OUTREC IFTHEN=(WHEN=GROUP,END=(1,1,CH,EQ,C'C'),PUSH=(81:ID=8))
  OUTFIL BUILD=(1,80),INCLUDE=(81,8,ZD,EQ,1)                     
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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