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 

output file needed bases on input requirement

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


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Tue Jul 27, 2010 11:02 pm    Post subject: output file needed bases on input requirement Reply with quote

Hi,

I have an input file with 22 bytes and RECFM=FB. I want to pull out all the records which have non RW in column 21-22 . Sometimes there could be a record in the first line which might have non RW but also I have to pick up the next record in case if it exists.
Code:

----+----1----+----2--
**********************
XYZSPQR  TS    0001 UT
    -THRU      0004   
XYZSPQR1 TS    0001 RW
    -THRU      0010   
XYZSPQR2 TS    0001 RW
    -THRU      0010   
XYZSPQR3 TS    0001 RW
    -THRU      0010   
XYZSPQR4 TS    0001 UT
    -THRU      0010   
XYZSPQR5 TS    0001 RW
    -THRU      0010   
XYZSASN  TS         UT
XYZSBSUS TS         RW

I want the output as:
Code:

----+----1----+----2--
**********************
XYZSPQR  TS    0001 UT
    -THRU      0004 
XYZSPQR4 TS    0001 UT
    -THRU      0010
XYZSASN  TS         UT
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jul 27, 2010 11:24 pm    Post subject: Reply with quote

yadav2005,

Try these untested control cards

Code:

//SYSIN  DD *
  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(21,2,CH,NE,C' '),PUSH=(23:21,2))
  OUTFIL INCLUDE=(23,2,CH,NE,C'RW'),BUILD=(1,22)
//*

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


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Wed Jul 28, 2010 6:02 am    Post subject: Reply with quote

Kolusu Thanks your code helped me a lot.
Back to top
View user's profile Send private message
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Fri Jul 30, 2010 1:56 am    Post subject: Reply with quote

yadav2005 wrote:
Kolusu Thanks your code helped me a lot.
Excellent kolusu.....
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