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

Insert space after copying of records from a file.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Mar 11, 2010 3:56 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 11, 2010 4:06 pm
Reply with quote

Hi,

create a file with a blank record and concatenate it with the other files.


Gerry
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Mar 11, 2010 4:14 pm
Reply with quote

Hello Gerry,

I dont think it will help because order of blank record will change depends upon sort criteria
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Mar 11, 2010 4:16 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Thu Mar 11, 2010 5:38 pm
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Mar 11, 2010 7:32 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 12, 2010 12:13 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 12, 2010 12:32 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Mar 12, 2010 3:23 am
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Fri Mar 12, 2010 9:19 am
Reply with quote

Thnaks Frank and Gerry for your replies..

Both of the solutions will work for me..

Regards,
Chandan
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top