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
 

 

ICETOOL - Reformat with SPLICE option

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

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 31, 2007 12:23 am    Post subject: ICETOOL - Reformat with SPLICE option
Reply with quote

I am attempting to reformat and splice two files together. IN1 is the BASE file. IN2 contains the names to be spliced into the IN1 file. I used the sample JCL on page 589 of the DFSORT Application Programming Guide as a guide. The input files are VB, 4096 and the reformatted files are FB, 39. Here are my JCL:

Code:

//S1 EXEC PGM=ICETOOL                                                 
//TOOLMSG DD SYSOUT=*                                                 
//DFSMSG DD SYSOUT=*                                                 
//IN1 DD DISP=SHR,DSN=HLQ.IRRDBU00.A102UG(0)                   
//IN2 DD DISP=SHR,DSN=HLQ.IRRDBU00.B200USR(0)                 
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(CYL,(500,50)),UNIT=SYSDA
//COMBINE DD SYSOUT=*                                                 
//CTL1OUT DD SYSOUT=*                                                 
//CTL2OUT DD SYSOUT=*                                                 
//TOOLIN DD *                                                         
* Reformat the File1 records for splicing                             
SORT FROM(IN1) TO(TEMP1) USING(CTL1)                                 
* Reformat the File2 records for splicing                             
COPY FROM(IN2) TO(TEMP1) USING(CTL2)                                 
* Splice the needed data from File1 and File2 together               
SPLICE FROM(TEMP1) TO(COMBINE) ON(10,8,CH) WITH(19,20)               
/*                                                                   
//CTL1CNTL DD *                                     
 OPTION NOVLSCMP,VLSHRT                             
 RECORD TYPE=F,LENGTH=38                             
 SORT FIELDS=(19,8,CH,A)                             
 INCLUDE COND=(5,4,CH,EQ,C'0102')                   
 OUTFIL OUTREC=(1:10,17,18:21C' '),CONVERT           
/*                                                   
//CTL2CNTL DD *                                     
 OPTION NOVLSCMP,VLSHRT                             
 RECORD TYPE=F,LENGTH=38                             
 INCLUDE COND=(5,4,CH,EQ,C'0200')                   
 OUTFIL OUTREC=(10:10,8,19:79,20),CONVERT           
/*                                                   


My first attempt tried to write the reformated IN1 and IN2 to TEMP1. The job gave an error that CTL1OUT and CTL2OUT were not defined. I added those DD statements with a SYSOUT=* (as seen above). When I ran it a 2nd time, it wrote the reformatted records to CTL1OUT and CTL2OUT, respectfully, and the unformatted original records ended up on the TEMP1 output DD statement.

After the reformat, here is what the CTL1OUT output looked like:

Code:

CICADMIT $H     
CICS043  $HNME   
CICADMIT $HSUP   
CICS043  $HSUP   
CLIENTS  $H0000$H
DB2LOAD  $H04301
P043     $H04301
CICS010  $1XXX   
CICADMIN $6     
CICS044  $6AP1   
CICADMIT $6CDJ   
CICS044  $6CDJ   
CICS044  $6CJ1   


here is what the CTL2OUT output looked like:
Code:

         $H       SYSTEM ADMINISTRATOR 
         $HNME    JIM SHORTS       
         $HSUP    PORTAL ADMIN         
         $H0000$H TEST 0431 JOE V       
         $H04301  BATCH ID             
         $6       DAVE DAVIDSON           
         $6AP1    TONY TIGER       
         $6CDJ    BARRY JACKSON     
         $6CJ1    MARY JACKSON     


I am attempting to SPLICE by the USERID (position 10 for 8). If a record on the BASE file does not have a match, it should be deleted. If a record on the Name splice file does not find a match on to the BASE, it should be deleted. You can have multiple records with the same USERID on the BASE file that should receive the names on the splice file like $6CDJ above.

How do you get the reformatted records to the TEMP1 file so they will splice correctly to the COMBINE DD statement?

Thanks in advance for you assistance.
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 Oct 31, 2007 12:53 am    Post subject:
Reply with quote

Get rid of CTL1OUT and CTL2OUT.

The reason you got the message about CTL1OUT and CTL2OUT is that you didn't specify the ddname (TEMP1) for your OUTFIL statements so DFSORT doesn't know where to put them and requested DDs for the default ddnames.

And why do you have TYPE=F for the input files when you say they're VB?
You don't need the RECORD statement at all - DFSORT will figure it out.

I'll start by just cleaning up your job a bit. Hopefully that be enough.

But if you need more help, then show me an example of the records in each input file and the expected output, and explain the rules for getting from input to output. Also give the starting position, length and format of each relevant field.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=HLQ.IRRDBU00.A102UG(0)
//IN2 DD DISP=SHR,DSN=HLQ.IRRDBU00.B200USR(0)
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(CYL,(500,50)),UNIT=SYSDA
//COMBINE DD SYSOUT=*
//TOOLIN DD *
* Reformat the File1 records for splicing
SORT FROM(IN1) USING(CTL1)
* Reformat the File2 records for splicing
COPY FROM(IN2) USING(CTL2)
* Splice the needed data from File1 and File2 together
SPLICE FROM(TEMP1) TO(COMBINE) ON(10,8,CH) WITH(19,20)
/*
//CTL1CNTL DD *
  OPTION NOVLSCMP,VLSHRT
  INCLUDE COND=(5,4,CH,EQ,C'0102')
  SORT FIELDS=(19,8,CH,A)
  OUTFIL FNAMES=TEMP1,OUTREC=(1:10,17,18:21C' '),CONVERT
/*
//CTL2CNTL DD *
  OPTION NOVLSCMP,VLSHRT
  INCLUDE COND=(5,4,CH,EQ,C'0200')
  OUTFIL FNAMES=TEMP1,OUTREC=(10:10,8,19:79,20),CONVERT
/*
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 31, 2007 1:13 am    Post subject: Reply to: ICETOOL - Reformat with SPLICE option
Reply with quote

We are very close.

The COMBINE output looks like:

Code:

CICADMIT $H       SYSTEM ADMINISTRATOR       
CICS043  $HNME    JIM SHORTS           
CICADMIT $HSUP    PORTAL ADMIN               
CLIENTS  $H0000$H TEST 0431 JOE V           
DB2LOAD  $H04301  BATCH ID                   
CICADMIN $6       DAVID DAVIDSON               
CICS044  $6AP1    TONY TIGER           
CICADMIT $6CDJ    BARRY JACKSON           
CICS044  $6CJ1    MARY JACKSON             


Records with a duplicate key on the base need to both get the name:

Code:

CICADMIT $HSUP   
CICS043  $HSUP
CICADMIT $6CDJ   
CICS044  $6CDJ


It should look like this on the COMBINE DD statement:

Code:

CICADMIT $H       SYSTEM ADMINISTRATOR       
CICS043  $HNME    JIM SHORTS           
CICADMIT $HSUP    PORTAL ADMIN
CICS043  $HSUP    PORTAL ADMIN               
CLIENTS  $H0000$H TEST 0431 JOE V           
DB2LOAD  $H04301  BATCH ID                   
CICADMIN $6       DAVID DAVIDSON               
CICS044  $6AP1    TONY TIGER           
CICADMIT $6CDJ    BARRY JACKSON 
CICS044  $6CDJ    BARRY JACKSON         
CICS044  $6CJ1    MARY JACKSON


Is there a keyword on the SPLICE statement that will accomplish this?
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 Oct 31, 2007 1:58 am    Post subject:
Reply with quote

Quote:
But if you need more help, then show me an example of the records in each input file and the expected output, and explain the rules for getting from input to output. Also give the starting position, length and format of each relevant field.


I don't have time to jump into the middle of what you're doing and try to understand it. Showing me the output without showing me the input or explaining the rules doesn't work for me. SPLICE has lots of keywords - WITHALL, KEEPBASE, KEEPNODUPS - but I can't tell you which ones you need without knowing all of what you're doing. Perhaps you can avoid starting from the beginning for me (if that's what you want) by investigating the SPLICE keywords yourself. Complete doc on SPLICE is at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 31, 2007 2:17 am    Post subject: Reply to: ICETOOL - Reformat with SPLICE option
Reply with quote

I just need to know if there are multiple records with the same key on IN1, is there a keyword that will result in a match for both records (rather than matching the 1st record and removing any subsequent records).
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 Oct 31, 2007 4:00 am    Post subject:
Reply with quote

If IN1 has duplicates and IN2 doesn't, then COPY IN2 to T1 first and then COPY IN1 to T1. You can then use the WITHALL parameter to SPLICE the base record (IN2 in T1 - no dups) with multiple overlay records (IN1 in T1 - dups). Remember that WITH is used for the fields from the overlay (IN1 in T1) records.

If that doesn't help, then I need more information, as previously requested, to help.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 31, 2007 6:34 pm    Post subject: Reply to: ICETOOL - Reformat with SPLICE option
Reply with quote

Thank you Frank. I had tried running with the WITHALL parameter with no success. Your suggestion to switch the order of the records going to TEMP1 was the key. Much appreciation.
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 Oct 31, 2007 8:42 pm    Post subject:
Reply with quote

Ok. (I could have told you that earlier if you'd provided the info I requested.)
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 31, 2007 9:00 pm    Post subject: Reply to: ICETOOL - Reformat with SPLICE option
Reply with quote

And I assumed from my first post I had already provided that information when I indicated that I was attempting to splice CTRLOUT and CRTLOUT together and showed examples of what needed to be spliced.
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 Oct 31, 2007 9:51 pm    Post subject:
Reply with quote

I just wanted to see the original input and the final expected output. Oh well - we managed to get there eventually.
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 BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


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