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 SPLICE

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

New User


Joined: 15 Feb 2006
Posts: 11
Location: Tampa, FL

PostPosted: Wed Feb 15, 2006 3:54 am    Post subject: ICETOOL SPLICE
Reply with quote

I'm having some difficulty with the Splice operator. I don't seem to be getting the results I want. I've included a few sample rows of my data that get concatenated in DD FILEIN and the ICETOOL statements I'm using.

DATASET 1
-------------
010500 000000000 GPD1LLTPA
017990 373600000 SN0144A01
018040 124670000 SN0144A01
018250 356710000 SN0444A04
018740 203680000 SN0644A02
018760 305910000 SN0644A02
019040 344690000 SN0644A02

DATASET 2
-------------
010500 000000000 PD0101105
017990 373600000 SN0144A09
018040 124670000 SN0144A08
018250 356710000 SN0144A11
018740 203680000 SN0644A06
018760 305910000 SN0644A06
019040 344690000 SN0444A04

ICETOOL STATEMENTS
---------------------------
SPLICE FROM(FILEIN) -
TO(FILEOUT) -
ON(1,17,CH) -
WITH(1,29)


** I also tried WITH(18,12), but got the same results.

OUTPUT RECEIVED
----------------------
010500 000000000 PD0101105 010500 000000000 PD0101105
017990 373600000 SN0144A09 017990 373600000 SN0144A09
018040 124670000 SN0144A08 018040 124670000 SN0144A08
018250 356710000 SN0144A11 018250 356710000 SN0144A11
018740 203680000 SN0644A06 018740 203680000 SN0644A06
018760 305910000 SN0644A06 018760 305910000 SN0644A06
019040 344690000 SN0444A04 019040 344690000 SN0444A04

OUTPUT DESIRED
--------------------
010500 000000000 GPD1LLTPA 010500 000000000 PD0101105
017990 373600000 SN0144A01 017990 373600000 SN0144A09
018040 124670000 SN0144A01 018040 124670000 SN0144A08
018250 356710000 SN0444A04 018250 356710000 SN0144A11
018740 203680000 SN0644A02 018740 203680000 SN0644A06
018760 305910000 SN0644A02 018760 305910000 SN0644A06
019040 344690000 SN0644A02 019040 344690000 SN0444A04

Ultimately, I'd get the record from Dataset 1 and the matching record's columns 18-29 from Dataset 2. Worst case would be Dataset 1 record and the entire matching Dataset 2 record on one row as shown above.

What am I doing wrong? I've reviewed the ICETOOL Mini-User Guide from Dec 2004 and been through some of the previous posts, but still can't quite get the process to work as I want. Can it? Thanks in advance for any clarification.
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 Feb 15, 2006 5:17 am    Post subject:
Reply with quote

I can't tell what your data really looks like ... if there are blanks, they've been removed. I don't think you have all of the data starting in position 1 for both files or you wouldn't have gotten the output you say you got.

You need to reformat the records so that the WITH data from input file2 is where you want it to be in the output file. I'd suggest reading through the discussion of SPLICE in "z/OS DFSORT Application Programming Guide" carefully. Here's a link to that discussion:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.13?DT=20050222160456

Just to give an example, I'll assume that the data in both files starts at position 1. Here's the DFSORT/ICETOOL job you'd need. I assumed your input files had RECFM=FB and LRECL=26, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=... input file1 (FB/26)
//IN2 DD DSN=... input file2 (FB/26)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/55)
//TOOLIN DD *
* Reformat file1 records to:
* |key|f1data|blanks|
COPY FROM(IN1) TO(T1) USING(CTL1)
* Reformat file2 records to:
* |key|blanks|f2data|
COPY FROM(IN2) TO(T1) USING(CTL2)
* SPLICE to get:
* |key|f1data|f2data|
SPLICE FROM(T1) TO(OUT) ON(1,17,CH) WITH(30,26)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,26,55:X)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,17,30:1,26)
/*


If you need more help, you need to tell me exactly what your input records look like - where does the data start in each case?
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Feb 15, 2006 9:53 am    Post subject:
Reply with quote

Hi,

Apart from what frank has told one reason may be that you are using
the same input file twice since the data in the output file for both the
input looks the same. Am not sure but this might be another reason
for the incorrect output.

Regards,
Back to top
View user's profile Send private message
tampakenny

New User


Joined: 15 Feb 2006
Posts: 11
Location: Tampa, FL

PostPosted: Wed Feb 15, 2006 7:38 pm    Post subject:
Reply with quote

Thanks for the help. Both my files were 29 byte records in the same layout. I was able to take the sample code and modify it ever so slightly to accomodate the bigger record size and it appears to be working based on initial testing. And I'm definitely adding the link you provided to my documentation stash. Thanks again!
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 Feb 15, 2006 9:57 pm    Post subject:
Reply with quote

Glad I could help.
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 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
No new posts ICETOOL higher option Anshul Das DFSORT/ICETOOL 14 Thu Apr 14, 2016 8:00 am
No new posts Compare Files and extract matching re... vimalravi83 DFSORT/ICETOOL 3 Wed Jan 06, 2016 2:42 pm


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