Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Combining Files based on files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Combining Files based on files
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 Moderator


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

PostPosted: Sat Dec 23, 2006 3:02 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Dec 23, 2006 7:08 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us