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
 

 

JOINKEYS or SPLICE? while retaining header/trailer on base

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

New User


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

PostPosted: Thu Apr 17, 2014 12:13 am    Post subject: JOINKEYS or SPLICE? while retaining header/trailer on base
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

Site Director


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

PostPosted: Thu Apr 17, 2014 6:43 pm    Post subject:
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: 187
Location: Toronto, ON, Canada

PostPosted: Fri Apr 18, 2014 12:35 am    Post subject: Reply to: JOINKEYS or SPLICE? while retaining header/trailer
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: 2
Location: United States

PostPosted: Fri Apr 18, 2014 11:21 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1720
Location: NY,USA

PostPosted: Fri Apr 18, 2014 11:56 pm    Post subject:
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    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 getting three output files out of JOI... migusd SYNCSORT 4 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am


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