View previous topic :: View next topic
|
Author |
Message |
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
I have a requirement, i have an input file as below
001 11 kajdkasd
002 11 dlksldakas
005 11 sdaslkdl
003 11 jsdkjfksdj
004 02 lkdlas
006 02 ldkasldk
008 13 djksdksd
here I need to get the output as below.
in count 11 : 4
count 02: 2
count 13:1
Regards,
Anand |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
Hi CICS Guy,
Thanks for your timely help,
But i am facing a problem, the output count is not equal to the input records,
say i have a input file with 111964 and in output it gives 111979 records.
so there is a mismatch between these two counts
i am using the below code in my sysin
OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(27,2,CH) ON(VALCNT)
please give us a soln.
Regards,
Anand |
|
Back to top |
|
|
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
anandkumarrn wrote: |
Hi CICS Guy,
Thanks for your timely help,
But i am facing a problem, the output count is not equal to the input records,
say i have a input file with 111964 and in output it gives 111979 records.
so there is a mismatch between these two counts
i am using the below code in my sysin
OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(27,2,CH) ON(VALCNT)
please give us a soln.
Regards,
Anand |
I missed to mention
i am using a input file which is Variable format. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
With the NOHEADER, I wonder where the 15 extra lines come from.
Have you looked at the first portion and the last portion of the output? |
|
Back to top |
|
|
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
CICS Guy wrote: |
With the NOHEADER, I wonder where the 15 extra lines come from.
Have you looked at the first portion and the last portion of the output? |
yes, based on that only i identified the count value |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
anandkumarrn wrote: |
yes, based on that only i identified the count value |
I don't quite understand.....
What does the sort message look like, could you post it here? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Anand,
It's not clear what you mean by the "output count". The count of records in the LIST data set would NOT match the count of input records unless you had NO duplicates. You only get one line per duplicate, so if you had two records with the same key, the input count would be 2, but the output count would be 1.
The sum of the ON(VALCNT) occurrences would equal the number of input records.
Since you said your records are VB, I assume your use of 27 for the starting position includes the RDW in positions 1-4. If not, you need to use 31 as the starting position, but the counts would add up either way.
For example, if I have these input records in INFILE (rrrr for the RDW):
Code: |
rrrr001 11 KAJDKASD
rrrr002 11 DLKSLDAKAS
rrrr005 11 SDASLKDL
rrrr003 11 JSDKJFKSDJ
rrrr004 02 LKDLAS
rrrr006 02 LDKASLDK
rrrr008 13 DJKSDKSD
|
and I use your OCCURS operator, I get this output in OUFILE:
Code: |
02 000000000000002
11 000000000000004
13 000000000000001
|
The input count is 7, but the count of records in the LIST data set is 3. However, the total of the VALCNT counts is 7.
If I look in TOOLMSG, I see this message which tells me the total number of input records processed is also 7.
Code: |
ICE628I 0 RECORD COUNT: 000000000000007
|
So the total of the VALCNT counts matches the input record count.
The count of records in the LIST data set does not match the input record count, but that's expected since there are duplicate records.
Are you saying that the value in ICE628I that does not match the total of the VALCNT values, or are you saying that the value in ICE628I does not match the actual number of input records, or what?
If you really think there's a mismatch, show the //TOOLMSG and //DFSMSG messages and indicate what you think the mismatched counts are. |
|
Back to top |
|
|
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
Hi Frank,
i would say my VALCNT and the input records doesn't match,
that is my input records say 1,00,000(1 lakh) and my output count(VALCNT) shows 1,00,015(1 lakh 15 records). so there is a mismatch between the input and the output VALCNT, i am getting this type of error if i have large number of records, i am getting exact count if i have less number of records in my input file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I can't help you without knowing exactly what you're doing. I don't know what your JCL looks like (for all I know, you could be using concatenation with referback and losing records due to a system restriction on doing that) or what messages you're getting.
I need to see the JES, //TOOLMSG and //DFSMSG output for the job you think has the mismatch. You can send it to me offline (yaeger@us.ibm.com) preferably as an attached text file. |
|
Back to top |
|
|
|