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 - joining numeric field with packed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JOINKEYS - joining numeric field with packed
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

Senior Member


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

PostPosted: Mon Dec 21, 2009 7:00 pm    Post subject:
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 Moderator


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

PostPosted: Mon Dec 21, 2009 11:09 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Dec 22, 2009 3:50 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Dec 22, 2009 3:52 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Dec 22, 2009 9:24 pm    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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