IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JOINKEYS or SPLICE? while retaining header/trailer on base


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hsinaz50

New User


Joined: 09 Apr 2014
Posts: 5
Location: United States

PostPosted: Thu Apr 17, 2014 12:13 am
Reply with quote

Hello Everyone,

Here is my base dsn sample:

H*20120105
DXY9-0000-
DXY2-0000-
DXY5-0000-
DXY3-0000-
TCOUNT04

Here is my look up DSN
SOMEDATA-XY5-0012
SOMEDATA-XY9-0345

Result/output dsn expected
H*20120105
DXY2-0000-
DXY3-0000-
DXY5-0012-
DXY9-0345-
TCOUNT04

So 1) retain the header and trailer on base. 2) Sort only detail (D) records on base on position 2 through 4 3) Pull position 14-17 from lookup by joining/matching on base (2-4) with lookup (10-12).

I tried simple DFSORT with JOINKEYS and found that the header and trailer both were at the top of the file, not OK.

I tried splice but I lost the header and trailer on output.

I am unable to figure out ICETOOL with JOINKEYS using HEADER TRAILER operator on COPY to retain the header trailer on output.

Please help!

Thanks!
hs
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 17, 2014 6:43 pm
Reply with quote

Hello and welcome to the forum,

You need to post the jcl and sort control statements you used for the JOINKEYS along with any diagnostic or informational messages generated.
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 202
Location: Toronto, ON, Canada

PostPosted: Fri Apr 18, 2014 12:35 am
Reply with quote

Avoid using SPLICE. I find it confusing.
You can still use JOINKEYS and provide extra statements to modify the sort sequence
Code:

//SYSIN DD *
 JOINKEYS FILE1=F1,FIELDS=(1,1,CH,A,3,3,CH,A)
 JOINKEYS FILE2=F2,FIELDS=(your-lookup-dsn-key-field)
 REFORMAT
etc.
//JNF1CNTL DD *
 INREC BUILD=(1,1,CHANGE=(1,
  C'H',C'1',
  C'T',C'3'),NOMATCH=(C'2'),
  1,record-length)

The CHANGE will take the first byte and change it to a '1', '2' or '3'

I have not tested it so you might have to do some debugging. This is just meant to show the general method.
Back to top
View user's profile Send private message
hsinaz50

New User


Joined: 09 Apr 2014
Posts: 5
Location: United States

PostPosted: Fri Apr 18, 2014 11:21 pm
Reply with quote

Thanks Dick & Jerryte!

Jerryte, I like your idea. I will use it in future. Alhough yesterday I resorted to using 3 steps to do this.

1) Sort the base using ICETOOL datasort ignoring header and trailer.
2) Sort and inrec build the lookup to keep keys and what I needed to pull.
3) Joinkeys the two above, using SORTED and NOSEQCK options.

Jerryte, I think I could have done it in one step using your trick. I am already in UAT so lazy to go back for this one icon_smile.gif

Thanks again!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Apr 18, 2014 11:56 pm
Reply with quote

I hope you don't run into any performance issues in case of millions of records.. So you may wants to check the CPU and elasped time by having actual volume of production. If it is going to be less records then that should be fine.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top