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
 

 

Comparing comp 3 field with numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Feb 26, 2013 7:41 pm    Post subject: Comparing comp 3 field with numeric field
Reply with quote

Please let me know how can we compare the comp 3 with numeric field using DFSORT or ICETOOL.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 26, 2013 7:48 pm    Post subject:
Reply with quote

What did the manual say ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Feb 26, 2013 7:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Feb 26, 2013 8:27 pm    Post subject: Reply to: Comparing comp 3 field with numeric field
Reply with quote

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
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Feb 26, 2013 11:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Tue Feb 26, 2013 11:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 27, 2013 12:03 am    Post subject:
Reply with quote

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
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Wed Feb 27, 2013 12:09 am    Post subject:
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Feb 27, 2013 2:44 am    Post subject:
Reply with quote

Five questions were asked and two of them were answered half way. icon_rolleyes.gif

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Feb 27, 2013 3:16 am    Post subject: Reply to: Comparing comp 3 field with numeric field
Reply with quote

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
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm


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