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

Combining Files based on files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
RANJINI
Warnings : 1

New User


Joined: 19 Apr 2005
Posts: 11

PostPosted: Sat Dec 23, 2006 2:09 am
Reply with quote

Hi,

I have 10 files. I have to combine them into a file based on a condition.

All the files, with record count 6 or less, should be merged into a single file.
Al the files with record count greater than 6 should be merged into a single file.

Hence there will be 2 output files.

For Ex:
F1 - has 10 records
F2 - has 6 records
F3- has 12 records
F4 - has 18 records
F5 - has 4 records
F6 - has 3 records

So my output file
Output File OF1 = F1+F3+F4
Output file OF2 = F2+F5+F6.

Please help me to do this using DFSORT.
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: Sat Dec 23, 2006 3:02 am
Reply with quote

What is the RECFM and LRECL of each input file?
Back to top
View user's profile Send private message
RANJINI
Warnings : 1

New User


Joined: 19 Apr 2005
Posts: 11

PostPosted: Sat Dec 23, 2006 3:17 am
Reply with quote

Frank,

All input files has same Recfm & Lrecl

Recfm - FB
Lrecl - 133

Thanks much.
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: Sat Dec 23, 2006 7:08 am
Reply with quote

Ranjini,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN01 DD DSN=...  input file01 (FB/133)
//IN02 DD DSN=...  input file02 (FB/133)
//IN03 DD DSN=...  input file03 (FB/133)
//IN04 DD DSN=...  input file04 (FB/133)
//IN05 DD DSN=...  input file05 (FB/133)
//IN06 DD DSN=...  input file06 (FB/133)
//IN07 DD DSN=...  input file07 (FB/133)
//IN08 DD DSN=...  input file08 (FB/133)
//IN09 DD DSN=...  input file09 (FB/133)
//IN10 DD DSN=...  input file10 (FB/133)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(IN01) USING(CT01)
COPY FROM(IN02) USING(CT02)
COPY FROM(IN03) USING(CT03)
COPY FROM(IN04) USING(CT04)
COPY FROM(IN05) USING(CT05)
COPY FROM(IN06) USING(CT06)
COPY FROM(IN07) USING(CT07)
COPY FROM(IN08) USING(CT08)
COPY FROM(IN09) USING(CT09)
COPY FROM(IN10) USING(CT10)
/*
//CT01CNTL DD *
  INREC OVERLAY=(134:C'01',136:8X)
//CT02CNTL DD *
  INREC OVERLAY=(134:C'02',136:8X)
//CT03CNTL DD *
  INREC OVERLAY=(134:C'03',136:8X)
//CT04CNTL DD *
  INREC OVERLAY=(134:C'04',136:8X)
//CT05CNTL DD *
  INREC OVERLAY=(134:C'05',136:8X)
//CT06CNTL DD *
  INREC OVERLAY=(134:C'06',136:8X)
//CT07CNTL DD *
  INREC OVERLAY=(134:C'07',136:8X)
//CT08CNTL DD *
  INREC OVERLAY=(134:C'08',136:8X)
//CT09CNTL DD *
  INREC OVERLAY=(134:C'09',136:8X)
//CT10CNTL DD *
  INREC OVERLAY=(134:C'10',136:8X)
//DFSPARM DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    TRAILER1=(134:134,2,136:COUNT=(M11,LENGTH=8))
  OUTFIL FNAMES=T2
//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=&&T1,DISP=(OLD,PASS)
//    DD DSN=&&T2,DISP=(OLD,PASS)
//OF1 DD DSN=...  output file1 (FB/133) count<=6
//OF2 DD DSN=...  output file2 (FB/133) count>6
//TOOLIN DD *
SPLICE FROM(CON) TO(OF1) ON(134,2,CH) -
  WITHALL WITH(1,133) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL FNAMES=OF1,INCLUDE=(136,8,ZD,LE,+6),BUILD=(1,133)
  OUTFIL FNAMES=OF2,INCLUDE=(136,8,ZD,GT,+6),BUILD=(1,133)
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top