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
 

 

can I do file balancing among 3 files ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
spkulkarni

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Fri Jun 09, 2006 9:42 pm    Post subject: can I do file balancing among 3 files ?
Reply with quote

Hi for 2 files balancing I use ICETOOL
Code:

//STEP020  EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1      DD DSN=PKAR.CP000000.PHUK.NDM.GRTV1.ILU.BK,DISP=SHR 
//IN2      DD DSN=PKAR.CP000000.PHUK.NDM.GRTV1.ILH.BK,DISP=SHR
//T1        DD DSN=&&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,5))
//T2        DD DSN=&&T2,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,5))
//CON       DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//              DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT1      DD DUMMY
//OUT2      DD DSN=TANGM.VAU.EXCEPTN,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=(SYSDA,15),
//             SPACE=(TRK,(100,20),RLSE),
//             DCB=(LRECL=22,RECFM=FB,BLKSIZE=0)
//TOOLIN    DD *
* IN1->T1: GET ONE RECORD WITH EACH KEY.
* ADD '11' ID IN 17-18.
SELECT FROM(IN1) TO(T1) ON(23,16,CH) FIRST USING(CTL1)
* IN2->T2: GET ONE RECORD WITH EACH KEY.
* ADD '22' ID IN 17-18.
SELECT FROM(IN2) TO(T2) ON(38,16,CH) FIRST USING(CTL2)
* T1/T2->OUT1/OUT2: SPLICE RECORDS WITH MATCHING KEYS.
* GET 1-16 FROM BASE RECORD AND 17 FROM OVERLAY RECORD.
* RESULTING ID IS '12' FOR RECORDS WE WANT IN OUT1 AND
* '11' FOR RECORDS WE WANT IN OUT2.
SPLICE FROM(CON) TO(OUT1) ON(1,16,CH) WITH(23,1) -
KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
 OUTFIL FNAMES=T1,OUTREC=(1,22,23:C'11')
//CTL2CNTL DD *
 OUTFIL FNAMES=T2,OUTREC=(1,22,23:C'22')
/*
//CTL3CNTL DD *
 OUTFIL FNAMES=OUT2,INCLUDE=(23,2,CH,EQ,C'12'),
 OUTREC=(1,22)
 OUTFIL FNAMES=OUT1,INCLUDE=(23,2,CH,EQ,C'11'),
 OUTREC=(1,22)
/*


Here Infile1 and Infile2 is hvng length 22 and having key-field on (1,16)
now the common records bet'n these 2 files will be present in OUT2 file.

Now my question is can I do the same for 3 files ?
i.e. I want to have a output file which will contain common key field (1,16) only. And output file will contain only key field(1.16)

Please note all the 3 input files are FB and having LRECL = 22 and are having key field on same position.
Back to top
View user's profile Send private message

sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Fri Jun 09, 2006 11:13 pm    Post subject:
Reply with quote

Hi,
Use the o/p file and the 3 rd file with the same logic so that you can get your desired o/p.You can go for another step of the same or you can code few more control cards to achive your final results.

Thanks
Krishy
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 Jun 10, 2006 3:43 am    Post subject:
Reply with quote

Quote:
Now my question is can I do the same for 3 files ?
i.e. I want to have a output file which will contain common key field (1,16) only. And output file will contain only key field(1.16)


It's not clear to me exactly what you want to do (or what you mean by "file balancing"), so please explain it, and please show a good example of the records in each of the three input files and what you expect for output.
Back to top
View user's profile Send private message
spkulkarni

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Sat Jun 10, 2006 11:25 am    Post subject:
Reply with quote

hi,

File balancing means i want to compare 3 input files on key field and create an output file which will contain common key field among 3 files.

Structure of file1
454638342000556600020060101
454638342000576400020060101
454638342000588900020060101
454638342000598800020060101
454638342000619200020060101

Structure of file2
454638342000556600120060101
454638342000576400220070101
454638342000588900020080101
454638342000598800020090101
454638342000619200020100101

Structure of file3
454638342000556600120110101
454638342000576400020120101
454638342000588900620130101
454638342000598800020140101
454638342000619200020150101

Please note that (1,19) is a key field in all the three files.
Now I want o/p file as:
4546383420005988000
4546383420006192000

I can achieve this in two steps using ICETOOL, but can I do this in only a single step ?
I tried to do it in 1 step but am not successful in doing so..
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: Sun Jun 11, 2006 1:51 am    Post subject:
Reply with quote

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

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
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(1,19,CH) -
  WITHEACH WITH(21,1) WITH(22,1) USING(CTL4)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,19,20:C'111')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,19,20:C'222')
/*
//CTL3CNTL DD *
  OUTREC FIELDS=(1,19,20:C'333')
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(20,3,CH,EQ,C'123'),
    OUTREC=(1,19)
/*
Back to top
View user's profile Send private message
spkulkarni

New User


Joined: 02 Jun 2006
Posts: 12

PostPosted: Mon Jun 12, 2006 11:10 am    Post subject:
Reply with quote

thanks very much Frank
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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