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 feilds from three files into one using ICETOOL

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

New User


Joined: 19 Apr 2006
Posts: 22
Location: bangalore

PostPosted: Tue Apr 17, 2007 4:14 pm    Post subject: Combining feilds from three files into one using ICETOOL
Reply with quote

Hi All,
I am trying to combine a feild which is present in three different files (not having same LRECL) into one file.My code is

Code:

//STEP01   EXEC PGM=ICETOOL,                     
//TOOLMSG  DD  SYSOUT=*                                       
//DFSMSG    DD  SYSOUT=*                                       
//INFIL1       DD  DSN=FILE1,DISP=SHR               
//INFIL2       DD  DSN=FILE2,DISP=SHR
//INFIL3       DD  DSN=FILE3,DISP=SHR
//TMP1         DD DSN=&&TMP,DISP=(MOD,PASS),
//                      SPACE=(CYL,(10,10)),       
//                      UNIT=SYSDA                                       
//OUTFIL      DD DSN=FILE4,                       
//                UNIT=(SYSDA,10),DISP=(NEW,CATLG),               
//                SPACE=(CYL,(10,5),RLSE)
//TOOLIN     DD *                                               
    COPY FROM(INFIL1) TO(TMP1) USING(CTL1)                     
    COPY FROM(INFIL2) TO(TMP1) USING(CTL2)                     
    COPY FROM(INFIL3) TO(TMP1) USING(CTL3)                     
    SPLICE FROM(TMP1) TO(OUTFIL) ON(1,12,ZD) WITH(13,5)       
/*   
//CTL1CNTL DD  *
      OUTREC  FIELDS= (1:5197,7,PD,TO=ZD,LENGTH=12) 
/*
//CTL2CNTL  DD  *
    OUTREC  FIELDS= (14:159,6,PD,TO=ZD,LENGTH=12)
/*
//CTL3CNTL  DD *
   OUTREC FEILDS =(27:3,6,PD,TO=ZD,LENGTH=12)
/*
//   


The feild(Emp no) which I am trying to combine is common in the three input files .
The Input and output looks like

Feild in File1 :
111222333444
111333222444
222111333444
222333111444

Feild in File2:
111333222444
222111333444
222333111444
333111222444

Feild in File3:
222111333444
222333111444
333111222444
444111222333

The output I am getting is

111333222444111333222444
222111333444222111333444

But the expected outputs is

111222333444 111333222444 222111333444
111333222444 222111333444 222333111444
222111333444 222333111444 333111222444
222333111444 333111222444 444111222333

Please let me know where I am going wrong ? Thanks
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 17, 2007 4:19 pm    Post subject:
Reply with quote

I think you may have to do it in two goes, SPLICE IN1 & IN2 to give OUT1, and then SPLICE IN3 with OUT1.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Apr 17, 2007 4:32 pm    Post subject:
Reply with quote

junaid83,

You need to use WITHALL option followed by 2 with options like

Code:
SPLICE FROM(TMP1) TO(OUTFIL) ON(1,12,ZD)
WITHALL WITH(13,5) WITH(27,5)


Note: Please change WITH(27,5) according to your third record position
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: Tue Apr 17, 2007 11:02 pm    Post subject:
Reply with quote

k.junaid83,

I don't see how you could have gotten the output you show with the job you show.

It appears you want to splice the fields record-by-record. In order to do that, you need to add a sequence number to each record and use SPLICE with WITHEACH. Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//STEP01   EXEC PGM=ICETOOL,
//TOOLMSG DD  SYSOUT=*
//DFSMSG  DD  SYSOUT=*
//INFIL1  DD  DSN=FILE1,DISP=SHR
//INFIL2  DD  DSN=FILE2,DISP=SHR
//INFIL3  DD  DSN=FILE3,DISP=SHR
//TMP1    DD DSN=&&TMP,DISP=(MOD,PASS),
//           SPACE=(CYL,(10,10)),
//           UNIT=SYSDA
//OUT  DD DSN=FILE4,
//        UNIT=(SYSDA,10),DISP=(NEW,CATLG),
//        SPACE=(CYL,(10,5),RLSE)
//TOOLIN     DD *
COPY FROM(INFIL1) TO(TMP1) USING(CTL1)
COPY FROM(INFIL2) TO(TMP1) USING(CTL2)
COPY FROM(INFIL3) TO(TMP1) USING(CTL3)
SPLICE FROM(TMP1) TO(OUTFIL) ON(1,12,ZD) WITH(13,5) -
  USING(CTL4)
/*
//CTL1CNTL DD  *
  OUTREC FIELDS=(1:5197,7,PD,TO=ZD,LENGTH=12)
/*
//CTL2CNTL  DD  *
    OUTREC FIELDS=(14:159,6,PD,TO=ZD,LENGTH=12)
/*
//CTL3CNTL  DD *
   OUTREC FEILDS=(27:3,6,PD,TO=ZD,LENGTH=12)
/*
//CTL4CNTL  DD *
  OUTFIL FNAMES=OUT,BUILD=(1,38)
/*
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Wed Apr 18, 2007 11:19 pm    Post subject: Re: Combining feilds from three files into one using ICETOOL
Reply with quote

Hi Frank,
Pls Can u explain TO=ZD,LENGTH=12 in
OUTREC FIELDS=(14:159,6,PD,TO=ZD,LENGTH=12)?

Thanks
Aneeta
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: Wed Apr 18, 2007 11:55 pm    Post subject:
Reply with quote

Code:

14:159,6,PD,TO=ZD,LENGTH=12


converts the 6-byte PD value starting at input position 159 to a 12-byte ZD value starting at output position 14.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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