Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing header and trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
ravindran1185

New User


Joined: 03 Nov 2008
Posts: 7
Location: Chennai

PostPosted: Thu Jul 09, 2009 3:48 pm    Post subject: Removing header and trailer
Reply with quote

Hi my question is,

File 1 header
r1
r2
trailer2

File 2 header
r3
r4
r5
trailer3

file 3

header
r6
trailer1

output should be like

header
r1
r2
r3
r4
r5
r6
trailer8

trailer count = 8 ( 6 records + 1 hed + 1 traile)

can this be done through Icetool ?

Can anyone provide me solution for this??

Thanks in advance.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 09, 2009 4:14 pm    Post subject:
Reply with quote

Quote:
can this be done through Icetool ?


Yes it is...


How about header in the output file?
Which header would come in the output out of all input file?

Also how do you identify header\detail\trailer records.....any record indicator?
what is lrecl\recfm of input and output?

which sort product you are using? as you have posted it in Interview Questions forum, it is confusing....
Back to top
View user's profile Send private message
ravindran1185

New User


Joined: 03 Nov 2008
Posts: 7
Location: Chennai

PostPosted: Thu Jul 09, 2009 4:24 pm    Post subject:
Reply with quote

Hi sambhaji,

Thanks for your reply.

header will be identifed using Hd
records will be identified using re
trailer will be identifed using tr

as of now i have written cobol program...

But i need this to be done using a utility ??

i heard this simple sort utility would help this. But i want this to be done using Icetool.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 09, 2009 5:13 pm    Post subject:
Reply with quote

Below SORT step will give you desired output...
Code:

//S1    EXEC  PGM=ICETOOL                                         
//SYSOUT    DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//TOOLMSG   DD  SYSOUT=*                                           
//IN DD *                                                         
HD                                                                 
RE1                                                               
RE2                                                               
TR0000002                                                         
/*                                                                 
//  DD *                                                           
HD                                                                 
RE3                                                               
RE4                                                               
RE5                                                               
TR0000003                                       
/*                                               
//  DD *                                         
HD                                               
RE6                                             
TR0000001                                       
/*                                               
//OUT DD  SYSOUT=*                               
//TOOLIN   DD    *                               
  COPY FROM(IN) TO(OUT) USING(CTL1)             
/*                                               
//CTL1CNTL DD *                                 
  SORT FIELDS=COPY                               
  OMIT COND=(1,2,CH,EQ,C'HD',OR,1,2,CH,EQ,C'TR')
  OUTFIL FNAMES=OUT,REMOVECC,HEADER2=(1:'HD'),   
  TRAILER1=(1:'TR',COUNT+2=(EDIT=(TTTTTTT)))     
/*                                               

Output will be
Code:

HD       
RE1       
RE2       
RE3       
RE4       
RE5       
RE6       
TR0000008
Back to top
View user's profile Send private message
ravindran1185

New User


Joined: 03 Nov 2008
Posts: 7
Location: Chennai

PostPosted: Thu Jul 09, 2009 5:22 pm    Post subject:
Reply with quote

Hi sambhaji,

Thanks a lot.

i will try this loigc.

i have one more question !!! jus trying out the possibilities..

if we get only the input file names ( which has more records) then what can be done in this case ??

Thanks in advance.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 09, 2009 5:28 pm    Post subject:
Reply with quote

Quote:
if we get only the input file names ( which has more records) then what can be done in this case ??


What do you mean by "( which has more records)"...
Please clarify...

Show sample example..
Back to top
View user's profile Send private message
ravindran1185

New User


Joined: 03 Nov 2008
Posts: 7
Location: Chennai

PostPosted: Thu Jul 09, 2009 5:31 pm    Post subject:
Reply with quote

Quote:
What do you mean by "( which has more records)"...



It mean as per the above code we are passing the records through sysin because we have only less number of records. if it has huge number of records???

It would be better if u have provide a solution for that case .[/quote]
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 09, 2009 5:34 pm    Post subject:
Reply with quote

Quote:

It mean as per the above code we are passing the records through sysin because we have only less number of records. if it has huge number of records???

It would be better if u have provide a solution for that case .
icon_eek.gif

You better try and let us know.. icon_lol.gif icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
ravindran1185

New User


Joined: 03 Nov 2008
Posts: 7
Location: Chennai

PostPosted: Thu Jul 09, 2009 5:35 pm    Post subject:
Reply with quote

Hi sambhaji,

Ya sure.

Thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts DSN name in trailer kranthikumarb DFSORT/ICETOOL 7 Mon Feb 29, 2016 11:30 am
No new posts Removing the MODETAB field in a VTAM ... rcwing All Other Mainframe Topics 1 Fri Feb 19, 2016 7:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us