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
 

 

Can we use PD Format fields in JOINKEYS
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 7:27 pm    Post subject: Can we use PD Format fields in JOINKEYS
Reply with quote

Hi ,
I have two files with a common PD field. when i tried to match the files using the common PD field, i am not getting the intended result. Can someone clarify , whether we can use PD field in JOINKEYS, otherwise , how to use the PD fields in the JOINKEYS.

Thanks
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 7:31 pm    Post subject:
Reply with quote

Post your JCL that is not getting the intended result.
Post an example of your input and the intended result.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 7:38 pm    Post subject:
Reply with quote

Quote:
FIELDS=(p,m,s<,p,m,s>...)
Must be specified to indicate the starting position, length and order (ascending or descending) of the keys in the
input file. The keys will be treated as binary, so they must be "normalized". For example, if the keys are actually
zoned decimal, they must have all C and D signs, or all F and D signs. You can use an INREC statement in
JNF1CNTL and/or JNF2CNTL to normalize the keys for the F1 file and/or F2 file, respectively, if appropriate.

Each pair of keys for the F1 and F2 files must match with respect to length and order, but can start in different
positions. For example, if the first key for the F1 file is 5 bytes ascending and the second key for the F1 file is 3
bytes descending, the first key for the F2 file must be 5 bytes ascending and the second key for the F2 file must be
3 bytes descending.

p specifies the starting position of the key. The first data byte of a fixed-length record is in position 1.
The first data byte of a variable-length record is in position 5 after the 4-byte RDW. p can be 1 to 32752 but all fields must
be completely contained within the first 32752 bytes of the record.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 7:55 pm    Post subject:
Reply with quote

Code:
JOINKEYS FILES=F1,FIELDS=(1,10,A,11,8,A)                             
JOINKEYS FILES=F2,FIELDS=(1,10,A,11,8,A)                             
JOIN UNPAIRED,F1,F2                                                   
REFORMAT FIELDS=(F1:1,10,F2:11,8,F1:19,586,F2:45,1,F1:606,253,F2:47,1,
                 F1:860,830,F2:35,10,F1:1700,301,F1:1,2000,F2:1,10)   
OUTFIL FNAMES=SORTOF01,INCLUDE(2001,10,CH,GT,C' ',AND,               
              4001,10,CH,GT,C' '),BUILD=(1,2000)                     
OUTFIL FNAMES=SORTOF02,INCLUDE(4001,10,CH,EQ,C' '),BUILD=(2001,2000)     
MERGE FIELDS=COPY

This is the Sort card i am using, Both the files have PD fields @ the position, 11,8. Even i tried to view the whole record (1:4010)..... but none of the records are matching between the two files based on the fields i have used for matching. 1,8 is a date field, and 11,8 is a PD field in both the files.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 8:02 pm    Post subject:
Reply with quote

other than record size, which I don't know if it is a problem,

Quote:

1,8 is a date field, and 11,8 is a PD field

but what is in columns 9 & 10?

Quote:

JOINKEYS FILES=F1,FIELDS=(1,10,A,11,8,A)
JOINKEYS FILES=F2,FIELDS=(1,10,A,11,8,A)

Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 8:07 pm    Post subject:
Reply with quote

Tut mir leid...... it was a typo :'( .... actually 1,10 is the date field and 11,8 is a PD field.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 8:09 pm    Post subject:
Reply with quote

When i tried to view the whole reformatted record, i.e, 1:4010, F2:11,8 are spaces for all the records. That means , the keys are itself not matching... right?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 8:15 pm    Post subject:
Reply with quote

maridawson,

how about
  1. all the JCL for the Sort Step
  2. are you sure the dates are of the same format? F1 uses '/', F2 uses '-' as separator?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 8:17 pm    Post subject:
Reply with quote

Since DFSORT does a binary compare on the JOINKEYS fields, the signs must be identical down to the bit representations, are they identical?
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 8:22 pm    Post subject:
Reply with quote

Herr Brenholtz,

1) JCL:
Code:
//PS0010   EXEC PGM=SORT                             
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//SYSOUT   DD SYSOUT=*                               
//SORTJNF1 DD DSN=FILE1,DISP=SHR                     
//SORTJNF2 DD DSN=FILE2,                             
//            DISP=SHR,BUFNO=20                       
//SORTOF01 DD DSN=MTCH.FILE,                         
//            DISP=(,CATLG,DELETE),                   
//            DCB=(RECFM=FB,LRECL=2000,BLKSIZE=0),   
//            UNIT=&UNIT,SPACE=&SP1                   
//*                                                   
//SORTOF02 DD DSN=UNMATCH.FILE,                       
//             DISP=(,CATLG,DELETE),                 
//             DCB=(RECFM=FB,LRECL=2000,BLKSIZE=0),   
//             UNIT=&UNIT,SPACE=&SP1                 





2) I am absolutely sure, both are using the seperator '-'.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 8:48 pm    Post subject:
Reply with quote

OMG,

I sorted both the files seperately, and tried to view the PD field in HEX ON format. This is what i found,

The last bit is differing, one value is 'C' and other one is 'F'. this is why all the records are not matching i guess.

Is there any way to sort this out ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 8:58 pm    Post subject:
Reply with quote

dbz wrote:
FIELDS=(p,m,s<,p,m,s>...)
Must be specified to indicate the starting position, length and order (ascending or descending) of the keys in the input file.

The keys will be treated as binary, so they must be "normalized". For example, if the keys are actually zoned decimal, they must have all C and D signs, or all F and D signs. You can use an INREC statement in
JNF1CNTL and/or JNF2CNTL to normalize the keys for the F1 file and/or F2 file, respectively, if appropriate.


now, how to do it? someone else will have to provide you syntax for the INREC statement.

by the way, congratulations on figuring out what your problem is.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 8:58 pm    Post subject:
Reply with quote

Here is a link to the JOINKEY writeup
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 9:01 pm    Post subject:
Reply with quote

Is there any way to ignore the sign bit alone, and do a comparison between the two files ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 9:09 pm    Post subject:
Reply with quote

I don't think DFSORT does half-byte compares.
that is why the SORT documentation says
use an INREC statement to change the sign of one of the files.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 9:16 pm    Post subject:
Reply with quote

Good catch Dick....
User Guide for DFSORT PTFs UK51706 and UK51707 wrote:
You can use an INREC statement in JNF1CNTL and/or JNF2CNTL to normalize the keys for the F1 file and/or F2 file, respectively, if appropriate.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 9:23 pm    Post subject:
Reply with quote

I am glad I was able to help.
Frank has told me more than once
to stay out of Sort discussions

we were able to help the poster determine his problem,
without, unfortunately, providing a solution.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Apr 29, 2010 9:30 pm    Post subject:
Reply with quote

Thanks a lot DBZ....... icon_biggrin.gif Thanks for your help.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 29, 2010 9:47 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
I am glad I was able to help.
Frank has told me more than once
to stay out of Sort discussions
I don't think he means to 'stay out', more just to not post invalid, untested and poorly thought out information.
Quote:
we were able to help the poster determine his problem,
without, unfortunately, providing a solution.
Of that, I am not so sure, because if the OP is using DFsort, the INREC statement in JNFnCNTL will (I think) solve his problem.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 9:55 pm    Post subject:
Reply with quote

Quote:
Of that, I am not so sure, because if the OP is using DFsort, the INREC statement in JNFnCNTL will (I think) solve his problem.


what I meant was a FRANK-level solution -
I could not provide the requisite INREC statement to convert.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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