View previous topic :: View next topic
|
Author |
Message |
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi All,
My requirement is as below:
I am merging around 20 files in one out put file with a SORT condition. There will no change in order of records due to sort condition. I want to insert a Blank line in final output once the records from each input file are copied
//SORTIN DD DSN1
// DD DSN2
// DD DSN3
// DD DSN4
// DD DSN5
//SORTOUT DD DSNF
//SORTIN DD *
I need my file DSNF to have data as below
DSN1 records
<SPACE>
DSN2 records
<SPACE>
DSN3 records
<SPACE>
DSN4 records
<SPACE>
DSN5 records
<SPACE>
Please help me out in this
Regards,
Chandan |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
create a file with a blank record and concatenate it with the other files.
Gerry |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Gerry,
I dont think it will help because order of blank record will change depends upon sort criteria |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Thanks Gerry.
It will solve my problem just for curosity is it possible by using DFSORT only?
If yes then it will also save creation of emty file which rather will not be useful afterwords
Thanks and regards,
Chandan |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
It is very difficult to tell if it will work by this way. You need to really explain your sort criteria if there is any.
If you are just copying all datasets to one they why to use sort why not just IEBGENER with trick what Gerry has mentioned? |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
I am just copying all the records to output file by elimination few records which are having particular string..
I am using following sort criteria
Option COPY
Omit Cond=(1,80,SS,EQ,C'STRING')
Regards,
Chandan |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
At the beginning of the job, create an empty temporary dataset.
In the COPY step concatenate this temporary dataset between the data files.
After the COPY, delete the temporary dataset. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Chandan,
Here's another way to do it with DFSORT/ICETOOL:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//IN3 DD DSN=... input file3
//IN4 DD DSN=... input file4
//IN5 DD DSN=... input file5
//OUT DISP=MOD,DSN=... MOD output file
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL1)
COPY FROM(IN3) USING(CTL1)
COPY FROM(IN4) USING(CTL1)
COPY FROM(IN5) USING(CTL1)
/*
//CTL1CNTL DD *
OMIT COND=(1,80,SS,EQ,C'STRING')
OUTFIL FNAMES=OUT,REMOVECC,TRAILER1=(X)
/*
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Ekta,
Quote: |
I dont think it will help because order of blank record will change depends upon sort criteria
|
Why do you think this ?
The op said
Quote: |
There will no change in order of records due to sort condition. I want to insert a Blank line in final output once the records from each input file are copied
|
The order of the records will not change.
Gerry |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Thnaks Frank and Gerry for your replies..
Both of the solutions will work for me..
Regards,
Chandan |
|
Back to top |
|
|
|