View previous topic :: :: View next topic
|
Author |
Message |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
Please let me know how can we compare the comp 3 with numeric field using DFSORT or ICETOOL. |
|
Back to top |
|
 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2468 Location: Netherlands, Amstelveen
|
|
|
|
What did the manual say ? |
|
Back to top |
|
 |
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8417 Location: Dubuque, Iowa, USA
|
|
|
|
Using COND maybe?
Really, are you asking HOW to do the comparison -- if so, there are plenty of examples on this forum and the Internet that you could easily find yourself. Furthermore, if you are going to ask on a professional forum for work product (such as code), be prepared to pay the going rate for such code (typically on this forum you will pay $500 to $1000 US per day or fraction of a day spent coding).
Or, if you are asking whether or not such a comparison can be done at all -- READ THE MANUAL! |
|
Back to top |
|
 |
Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7314
|
|
|
|
Yes, in the usual way. There is no problem comparing a PD to a ZD. Is that all you want to know,? As Peter and Robert have indicated, it is fully documented. There are links to the manuals in this forum and on the top line of the pages for the site. |
|
Back to top |
|
 |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
Please let me know if there are any keywords which can used to get the information. I am trying to search in all the manual but it is taking lot of time.
I want to compare a pack decimal to numeric field in jcl.
You expert advise will be very helpful to me. |
|
Back to top |
|
 |
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8417 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I want to compare a pack decimal to numeric field in jcl. |
This CANNOT be done -- JCL executes programs and only executes programs. You can use a sort in JCL to do the comparison (and you OBVIOUSLY did not read -- or understand -- my earlier post or you would not be asking about which keyword to use), but JCL per se cannot do it. |
|
Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
deepak.kec wrote: |
Please let me know if there are any keywords which can used to get the information. I am trying to search in all the manual but it is taking lot of time.
I want to compare a pack decimal to numeric field in jcl.
You expert advise will be very helpful to me. |
deepak.kec,
You are going in circles. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
Do you want to INCLUDE/OMIT records validating a PD field to another numeric field on the same record within the same file?
Please answer ALL of the following questions.
1. What is the LRECL and RECFM of input and output files?
2. What is the Position of the packed decimal field you want to validate?
3. What is the COBOL declaration of the Packed decimal field?
4. What are the RULES of validation/comparison?
5. Last but not least run the following sample JOB and show me the COMPLETE sysout which will help us determine the level of DFSORT you running.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
//* |
|
|
Back to top |
|
 |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
I am sorry for my ignorance and shall have given you more information.
I need to compare the two file, one is having data in packed decimal and other one is having in numeric. Need to compare them and write first file to output file when the matching record is found.
Both the files are Fixed block and are of different length. |
|
Back to top |
|
 |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 717 Location: Pennsylvania
|
|
|
|
Five questions were asked and two of them were answered half way.
1. Half an answer given.
2. No answer
3. No answer
4. Half an answer (sort of)
5. No answer
Why does Skolusu or anybobdy ever bother? |
|
Back to top |
|
 |
Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7314
|
|
|
|
We had no clue you wanted to compare between files.
Here is a sample. The thing for JOINKEYS with numerics is that they have to be in the same format, they have to be "normalised". JOINKEYS is just operating on "binary" data, not a field-type, so your data-fields have to be of the same type for it to work. All JOINKEYS key field "pairs" (one on file 1, one on file 2) have to be the same length, but can start at different positions.
I have chosen here to make the ZD into a PD, as it will keep the records shorter.
You do this in a JNFnCNTL dataset, with the "n" being 1 or 2 depending on which file has the ZD field (you haven't mentioned, so I've done it on file 2). The PD is created at the "end" of the Fixed-length record. My records are 80-bytes, so the new field starts at position 81.
The "default" for JOINKEYS is just to select the matched records. You only want file 1 data, so there is a REFORMAT statement to create the records from file 1 only. These records will be written to SORTOUT as part of the COPY operation (in this case) which runs as an integral part of the JOINKEYS processing, after the join has been made.
If your data is in the sequence of the numbers you are using, then you can add SORTED,NOSEQCK to the JOINKEYS statements. Otherwise a SORT, with EQUALS, will be performed for each file.
Code: |
//MATPDZD EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD your output file
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,5,A)
JOINKEYS FILE=F2,FIELDS=(81,5,A)
REFORMAT FIELDS=(F1:1,80)
OPTION COPY
//JNF2CNTL DD *
INREC OVERLAY=(81:1,9,ZD,TO=PD,LENGTH=5)
//SORTJNF1 DD your file one
//SORTJNF2 DD your file two
|
If, instead, you have a key to match the records, then you want to compare the numeric values, it is still easy. Specify the key positions on the JOINKEYS, include the numeric from file 2 on the REFORMAT as well, and use
Code: |
INCLUDE COND=(position/length/type of file 1 data,EQ,position/length/type of file2 data)
|
If it is something else you want, please take the time to explain clearly and fully, paying attention to all the questions that have been asked of you. |
|
Back to top |
|
 |
|