IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Removing header and trailer


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
No new posts Removing date values lines/records fr... SYNCSORT 2
Search our Forums:

Back to Top