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 header and selective sub-records...

 
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 Aug 26, 2009 10:05 am    Post subject: Copy header and selective sub-records... Reply with quote

Hi,

My input file comes like this (LRECL=100, RECFM=FB)..

Code:

----+----1----+----2----+----3----+----4----+----5
ABC9     ORDERDETAILS365001
72207HBC002         A0      3009082572A025072207
72207HBC003         A0      3009082572B125072207
72207HBC005         A0      3009082572C225072207
ABC6     ORDERDETAILS365002
72207YBC002         A0      3009082572A025072207
72207YBC001         A0      3009082572B125072207
72207YBC006         A0      3009082572C325072907
72207YBC006         A0      3009082572B225072807


I would like to pull records as shown here: Header records and also the records that have 'B' appearing in 39th position.
Code:

----+----1----+----2----+----3----+----4----+----5
ABC9     ORDERDETAILS365001
72207HBC003         A0      3009082572B125072207
ABC9     ORDERDETAILS365002
72207YBC001         A0      3009082572B125072207
72207YBC006         A0      3009082572B225072807


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 Aug 26, 2009 10:20 am    Post subject: Reply with quote

mf_user,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DSN=your 100 byte Fb file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'ABC'),PUSH=(101:1,100))
  OUTFIL INCLUDE=(39,1,CH,EQ,C'B'),REMOVECC,BUILD=(1,100),           
  SECTIONS=(101,100,HEADER3=(101,100))                               
/*

_________________
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: Wed Aug 26, 2009 11:24 am    Post subject: Reply with quote

Kolusu, I will try it and come back... Thx.
_________________
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
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Aug 28, 2009 4:58 am    Post subject: Reply with quote

Thanks a lot Kolusu. I have got my results. Smile
_________________
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