How to join 2 packed fields ?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to join 2 packed fields ?

Postby SMain » Fri Feb 17, 2012 2:05 pm

Hi ,

I have to join 2 files on the feilds which are packed .
One field has signed positive packed number and the other has unsigned positive packed number . Will I get a match if I'm able to join the files
SMain
 
Posts: 7
Joined: Tue Jan 31, 2012 2:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to join 2 packed fields ?

 

Re: How to join 2 packed fields ?

Postby BillyBoyo » Fri Feb 17, 2012 2:18 pm

Which sort product are you using? Sizes of fields? DCB and RECFM?

Have you looked at your product's documentation? The answer will be there. Look at the definitions of data types.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to join 2 packed fields ?

Postby SMain » Fri Feb 17, 2012 2:58 pm

I have 2 fields, 1 is of 10 packed and other is 20 ZD ,So I've converted the 2nd field in PD and now I'm trying to join using Syncsort
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(2,10,A)
But the probme I'm facing is that since I converted a ZD to PD , I have 'F' in my last nibble whereas in the other file I have 'C' in the last nibble .
SMain
 
Posts: 7
Joined: Tue Jan 31, 2012 2:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to join 2 packed fields ?

Postby enrico-sorichetti » Fri Feb 17, 2012 3:03 pm

unlike ibmmainframes.com where syncsort issues are discussed in the JCL section
this forum has dedicated sections for both <sort> flavors

good manners dictate to post questions in he proper section.
after You have discovered the <sort> product You are using
WER.... messages ==> SYNCSORT
ICE.... messages ==> DFSORT
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: How to join 2 packed fields ?

Postby SMain » Fri Feb 17, 2012 3:15 pm

Haven't gone through the forum completely ,saw jcl and thought this is where my query fits in .
SMain
 
Posts: 7
Joined: Tue Jan 31, 2012 2:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to join 2 packed fields ?

Postby Akatsukami » Fri Feb 17, 2012 4:04 pm

SMain wrote:Haven't gone through the forum completely ,saw jcl and thought this is where my query fits in .

Please learn that this type of task is performed by a utility program, most likely either DFSORT or Syncsort, not by JCL, which in fact does nothing but establish environments and execute the programs that use them.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to join 2 packed fields ?

Postby BillyBoyo » Sat Feb 18, 2012 1:19 am

You haven't even shown or told us how you are doing the conversion. You haven't said which sort package you use.

If you are doing the conversion with Sort control cards, look at the effect of PDC instead of PD. Confirm by following my previous suggestion, so you don't have to ask each time (and proudly ask in the wrong place) you come across a new data type.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to join 2 packed fields ?

Postby Anuj Dhawan » Sat Feb 18, 2012 1:28 pm

SMain wrote:I have 2 fields, 1 is of 10 packed and other is 20 ZD ,So I've converted the 2nd field in PD and now I'm trying to join using Syncsort
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(2,10,A)
But the probme I'm facing is that since I converted a ZD to PD , I have 'F' in my last nibble whereas in the other file I have 'C' in the last nibble .
I'm not sure if you are showing us exactly what you are doing because in above Sort-statements, for F1 you've the key of length of 9-bytes while for F2 it's 9-bytes. May be a typo but that's what posted on this Forum & one can refer to.

1. I've not verified but conversion from ZD to PD and compare can be done in one step.
2. If now you're dealing with "C" and "F" for the sign nibble, try the below sort:

/STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//PDF      DD DSN=Your PDF input file1,DISP=SHR
//PDC      DD DSN=Your PDC input file1,DISP=SHR
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  OPTION COPY                             
  JOINKEYS F1=PDF,FIELDS=(1,10,A)         
  JOINKEYS F2=PDC,FIELDS=(1,10,A)         
  JOIN UNPAIRED                           
  REFORMAT FIELDS=(F1:1,80,?,F2:1,80)     
//JNF1CNTL DD *                           
  INREC OVERLAY=(1:1,10,PD,TO=PDC,LENGTH=10) 
//JNF2CNTL DD *                           
  INREC OVERLAY=(1:1,10,PD,TO=PDC,LENGTH=10) 
//*
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: How to join 2 packed fields ?

Postby Anuj Dhawan » Sat Feb 18, 2012 1:29 pm

And they are DFSort control cards... .
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post