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

JOINKEYS - joining numeric field with packed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Mon Dec 21, 2009 1:42 pm
Reply with quote

Hi - is it possible to use JOINKEYS on joining a numeric field with a packed decimal field.

Thanks for the help.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 21, 2009 7:00 pm
Reply with quote

What does manuals have to say? If you're a syncsort user, see "Joining Records from Multiple Files" in item DATA-UTILITY.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 21, 2009 11:09 pm
Reply with quote

Quote:
is it possible to use JOINKEYS on joining a numeric field with a packed decimal field.


Yes, but since JOINKEYS only deals with binary fields, you would have to "normalize" one of the fields first so it can be compared with the other as BI format. With DFSORT's JOINKEYS, you can do that as part of the JOINKEYS application by using an INREC statement for one of the subtasks. You don't need an extra pass to do the normalization.

If you are using DFSORT and have the Nov, 2009 PTF installed and want more information on how to do this, give a complete description of your requirement. RECFM and LRECL of the input file; starting position, length and format of the relevant fields; an example of the records in the input files and expected output.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Dec 22, 2009 2:24 pm
Reply with quote

hi Frank/Anuj - Thanks. I am a SYNCSORT user.

Looking at the manual, it seems that in the priority of control statements for SYNCSORT:

i) INCLUDE/OMIT
ii) JOINKEYS
iii) INREC
iv) SORT
v) SUM / DUPKEYS
vi) OUTREC

JOINKEYS have more priority than INREC. So, am i correct in thinking that it cannot be done in a single step? I need to write another step to reformat the records and then pass on to the JOIN step.

Thanks for your help
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 22, 2009 3:50 pm
Reply with quote

Quote:
So, am i correct in thinking that it cannot be done in a single step?
May be icon_confused.gif, you did not tell us what you were trying to do.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 22, 2009 3:52 pm
Reply with quote

And the question in first post from you (is it possible to use JOINKEYS on joining a numeric field with a packed decimal field. ) is totally different than what you ask in next post
Quote:
priority of control statements
icon_confused.gif
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Dec 22, 2009 7:27 pm
Reply with quote

Hi Anuj, sorry for the confusion... icon_sad.gif

let me explain in details..

I have two files

File1
Code:

0001A
0002B
0003B
0004N
0005M


File2 (first 3 chars are packed and values same as File1)
Code:

.>.JOHN
.#.JIM
./.JESSIE
.?.JEREMY
.;.JACK


Now, I want to join these and get the output file something like

Code:

0001JOHN         A
.
.
. and so on


and the question is, within a single SORT step (i think) it will not be possible to use JOINKEYS, because JOINKEYS should have same length for the keys of both files.. and INREC cannot be used in that step to reformat the packed decimal to binary or numeric prior to JOINKEYS because JOINKEYS are executed prior to INREC as per manual and also, i am not sure how can INREC work on just one file... icon_sad.gif

was i clear this time ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 22, 2009 9:24 pm
Reply with quote

With DFSORT's JOINKEYS, you can actually use different INREC statements to preprocess the F1 records, preprocess the F2 records, and/or post-process the joined records, so you could do what you want without extra passes. You can use JNF1CNTL for control statements to preprocess F1, JNF2CNTL for control statements to preprocess F2, and SYSIN (or DFSPARM) to postprocess the joined records. For complete details, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174

AFAIK, Syncsort's JOINKEYS cannot preprocess F1 and F2 so you would need separate passes. I'm sure the Syncsort guys will correct me if I'm wrong.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
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
Search our Forums:

Back to Top