Joined: 04 Jan 2008 Posts: 7 Location: Chennai, India
I assume that you have the counts in two files and want to compare those two (numerals).
Also provide the following details.
#1 Is there a common field in both the files (say some key field)?
#2 Does both the files (containing the record counts) have same number of records? If no post what needs to be done in that case.
#3 What should be done if the record counts are equal and when not equal.
Tip: Use SPlICE operator and merge the two file and then compare the counts (the numeric field you want to compare).
ill rephrase my question:--
I have a input file with N records.
I get 2 output files (derived from the input file) with X and Y as thier record counts respectively.
I want to check whehter the sum of no of records (X+Y) in the output files is equal to no of records in the input file (N)
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
What program or utility are you using to create the 2 output files with X and Y? Can you have that program create an output file with N at the same time? What do the output records look like? What is the RECFM and LRECL of the output files? Do you actually need an ABEND or would a non-zero return code do as well?
the 3 files are already created(out of which 2 files just have a number say x & y respectively, lrecl20) and their recfm is fb and the third file(having n records,lrecl=1300)is first counted for the no. of records and then we want to see whether x+y=n we want an abend...if not equal
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you are using z/OS DFSORT V1R5 (which supports NULLOUT and NULLOFL), then you can use USING(xxxx) for SPLICE and put NULLOFL=RC16 on the OUTFIL statement with FNAMES=OUT.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
marimuthu_G,
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your count files each have one record with a 10-byte ZD count, but the job can be changed appropriately for whatever you have. You need to have z/OS DFSORT V1R5 to use NULLOFL (it isn't supported with DFSORT R14). If x+y=n, the job will pass back RC=0. If x+y<>n, the job will issue a U0209 ABEND.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
marimuthu_G,
The JCL I have shown works fine giving me the right results. If it not working for you, then I need to see the DFSMSG sysout. Show me the messages . Note that you need z/OS DFSORT V1R5 and higher which supports NULLOUT and NULLOFL . If you are running a different version then may be you are getting a syntax error which results in RC16
I have a requirement where the total number of records is specified in the header.
I need to compare if it match with the total records in the file and return an error code if it is not match.
The code is working fine and I manage to understand the logic also yesterday night.
I have another problem now, my senior is asking why I didn't use ICETOOL as she never heard of ICEMAN.
I am not sure of the differences...can anyone help?
The code works in development but am not sure if it will work in production cause so far no one used ICEMAN here...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I have another problem now, my senior is asking why I didn't use ICETOOL as she never heard of ICEMAN.
Explain to your "senior" that PGM=ICEMAN and PGM=SORT both invoke DFSORT. There is no difference between them. PGM=ICETOOL invokes DFSORT's ICETOOL utility.
PGM=SORT and PGM=ICEMAN have been available for over 30 years.
PGM=ICETOOL is a relative newcomer in that it has only been available since 1991.