Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm
No new posts Splice more than 50 occurances rajatbagga DFSORT/ICETOOL 1 Wed Oct 11, 2017 9:36 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us