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 

How to copy header & trailer records.

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


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Aug 28, 2009 10:55 am    Post subject: How to copy header & trailer records. Reply with quote

Hi,

My input data is as shown below:
Code:

JFK5     COMSTATE1004525XL5
JFK5     COMSTATE1004524XL5                             
12007NNNTJW1GYUCCEF AR      3009082712C000412007N6C10706 92392213        001
JFK5     COMSTATE1004506XL5                             
JFK5     COMSTATE1004505XL5                             
JFK5     COMSTATE1004503XL5                             
31027AMWZ1H1GYUKJEF AR      3009082512S000423812N6K10906 92391529        001
35100BNFSVR1GYUKEEJ AR      3009082512T000423081N6K10706 92391529        001
36002CNKC581GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
23029DNMV941GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
22285ENNBW31GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
36234FNNPS41GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
12007GNNTJW1GYUCCEF AR      3009082512T0004     N6C10706 92391529        001
22157HNPVVR1GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
JFK5     COMSTATE1004484XL5                             
JFK5     COMSTATE1004482XL5                             
46308IKKC9V1G4GE5EV AF      3009081811T0004     N   4GT6992391336        00G
46308JKKDBK1G4GE5EV AF      3009081811T0004     N   4GT6992391336        00G
34421KKNDFM1G4GD5EG AF      3009072111S0004     N   4GM6992391336        00G


I want to select only the header and trailer records which are continous as shown below:
Code:

JFK5     COMSTATE1004524XL5                             
12007NNNTJW1GYUCCEF AR      3009082712C000412007N6C10706 92392213        001
JFK5     COMSTATE1004503XL5                             
31027AMWZ1H1GYUKJEF AR      3009082512S000423812N6K10906 92391529        001
35100BNFSVR1GYUKEEJ AR      3009082512T000423081N6K10706 92391529        001
36002CNKC581GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
23029DNMV941GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
22285ENNBW31GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
36234FNNPS41GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
12007GNNTJW1GYUCCEF AR      3009082512T0004     N6C10706 92391529        001
22157HNPVVR1GYUKJEF AR      3009082512T0004     N6K10906 92391529        001
JFK5     COMSTATE1004482XL5                             
46308IKKC9V1G4GE5EV AF      3009081811T0004     N   4GT6992391336        00G
46308JKKDBK1G4GE5EV AF      3009081811T0004     N   4GT6992391336        00G
34421KKNDFM1G4GD5EG AF      3009072111S0004     N   4GM6992391336        00G


I don't want copy the only header records that don't have trailer records.

Please help.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 28, 2009 10:57 am    Post subject: Reply with quote

ranga_subham,

How do you identify the header and trailer? what is the LRECL and recfm of the input and output file?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Aug 28, 2009 11:07 am    Post subject: header identification. Reply with quote

Kolusu, the header is identified by several things appearing in the line..
Code:

----+----1----+----2----+----3
JFK5     COMSTATE1004525XL5


Quote:

1). It always starts with an alphabet like "J" at 1st column.
2). It always have XL5 appearing starting at 25th column.
3). It always have an alphabet at 10th column.


The LRECL is 80 and RECFM is FB.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 28, 2009 11:41 am    Post subject: Reply with quote

ranga_subham,

Use the following DFSORT control cards

Code:

//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(01,1,CH,EQ,C'J',AND,             
  10,1,FS,NE,NUM,AND,25,3,CH,EQ,C'XL5'),PUSH=(81:SEQ=8,1,80))
     
  OUTFIL INCLUDE=(81,8,ZD,GE,2),IFOUTLEN=80,                       
  IFTHEN=(WHEN=(81,8,ZD,EQ,2),BUILD=(89,80,/,1,80))               
/*

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


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Mon Aug 31, 2009 5:14 am    Post subject: thank you Reply with quote

Kolusu, thanks for the timely help.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
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