View previous topic :: View next topic
|
Author |
Message |
ravindran1185
New User
Joined: 03 Nov 2008 Posts: 7 Location: Chennai
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
ravindran1185
New User
Joined: 03 Nov 2008 Posts: 7 Location: Chennai
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
ravindran1185
New User
Joined: 03 Nov 2008 Posts: 7 Location: Chennai
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
ravindran1185
New User
Joined: 03 Nov 2008 Posts: 7 Location: Chennai
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 . |
You better try and let us know.. |
|
Back to top |
|
|
ravindran1185
New User
Joined: 03 Nov 2008 Posts: 7 Location: Chennai
|
|
|
|
Hi sambhaji,
Ya sure.
Thanks. |
|
Back to top |
|
|
|