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 with one header & data needed

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


Joined: 06 May 2004
Posts: 27
Topics: 16
Location: Bangalore

PostPosted: Mon Jun 21, 2004 6:23 am    Post subject: output file with one header & data needed Reply with quote

I have a file with headers & data, the headers are same for all the data, like

HHHHHHHHHHHHHHHHHHHHHHHHH
11111111111111111111111111111 |
22222222222222222222222222222 |---> data
33333333333333333333333333333 |
HHHHHHHHHHHHHHHHHHHHHHHHH
44444444444444444444444444444 |
55555555555555555555555555555 |----> data
66666666666666666666666666666 |
HHHHHHHHHHHHHHHHHHHHHHHHH
77777777777777777777777777777 |
88888888888888888888888888888 |----> data



All the 'H' represents headers & are same for all the data.

i want a output file with only one header at the top & rest data like

HHHHHHHHHHHHHHHHHHHHHHHHHH | ----> Header
111111111111111111111111111111 |
222222222222222222222222222222 |
333333333333333333333333333333 |
444444444444444444444444444444 |----> data
555555555555555555555555555555 |
666666666666666666666666666666 |
777777777777777777777777777777 |
888888888888888888888888888888 |


Please let me know how to acomplish it.

Thanks
_________________
Arun
"Genius is one percent inspiration and ninety-nine percent perspiration." -- Thomas A. Edison
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jun 21, 2004 7:45 am    Post subject: Reply with quote

Arunkumar,

There are many ways of doing it. If you are header can be regenerated then the following JCl will give you the desired results. I assumed that your input file is 80 bytes in length and is of FB recfm.

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT    DD SYSOUT=*                       
//SORTIN    DD *                               
HHHHHHHHHHHHHHHHHHHHHHHHH                     
11111111111111111111111111111 |               
22222222222222222222222222222 |---> DATA       
33333333333333333333333333333 |               
HHHHHHHHHHHHHHHHHHHHHHHHH                     
44444444444444444444444444444 |               
55555555555555555555555555555 |----> DATA     
66666666666666666666666666666 |               
HHHHHHHHHHHHHHHHHHHHHHHHH                     
77777777777777777777777777777 |               
88888888888888888888888888888 |----> DATA     
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *                               
  SORT FIELDS=COPY                             
  OMIT COND=(1,1,CH,EQ,C'H')                   
  OUTFIL REMOVECC,HEADER1=(80C'H')             
/*                                   


In the above code we first omit all the records with 'H' and use the HEADER1 parm to create the header which will be 80 bytes of 'H"

Method: 2 We add a seqnum at the end and using include cond on outfil we just include only the first header rec and other detail records.

Code:

//STEP0200 EXEC PGM=SORT                                             
//SYSOUT    DD SYSOUT=*                                               
//SORTIN    DD *                                                     
HHHHHHHHHHHHHHHHHHHHHHHHH                                             
11111111111111111111111111111 |                                       
22222222222222222222222222222 |---> DATA                             
33333333333333333333333333333 |                                       
HHHHHHHHHHHHHHHHHHHHHHHHH                                             
44444444444444444444444444444 |                                       
55555555555555555555555555555 |----> DATA                             
66666666666666666666666666666 |                                       
HHHHHHHHHHHHHHHHHHHHHHHHH                                             
77777777777777777777777777777 |                                       
88888888888888888888888888888 |----> DATA                             
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *                                                     
  SORT FIELDS=COPY                                                     
  INREC FIELDS=(1,80,SEQNUM,8,ZD)                                     
  OUTFIL INCLUDE=((1,1,CH,EQ,C'H',AND,81,8,ZD,EQ,1),OR,1,1,CH,NE,C'H'),
  OUTREC=(1,80)                                                       
/*


Method: 3 change the pgm to synctool if you have syncsort at your shop
Code:

//STEP0200 EXEC PGM=ICETOOL                 
//TOOLMSG   DD SYSOUT=*                     
//DFSMSG    DD SYSOUT=*                     
//IN        DD *                             
HHHHHHHHHHHHHHHHHHHHHHHHH                   
11111111111111111111111111111 |             
22222222222222222222222222222 |---> DATA     
33333333333333333333333333333 |             
HHHHHHHHHHHHHHHHHHHHHHHHH                   
44444444444444444444444444444 |             
55555555555555555555555555555 |----> DATA   
66666666666666666666666666666 |             
HHHHHHHHHHHHHHHHHHHHHHHHH                   
77777777777777777777777777777 |             
88888888888888888888888888888 |----> DATA   
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(MOD,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//TOOLIN    DD *                       
  COPY FROM(IN) TO(OUT) USING(CTL1)     
  COPY FROM(IN) TO(OUT) USING(CTL2)     
//CTL1CNTL  DD *                       
  OPTION STOPAFT=1                     
//CTL2CNTL  DD *                       
  OMIT COND=(1,1,CH,EQ,C'H')           
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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