| View previous topic :: View next topic |
| Author |
Message |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Tue Jan 06, 2009 4:07 am Post subject: count records until some condition met |
|
|
Hi,
How do we count records until some condition is met?
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12400 Topics: 75 Location: San Jose
|
Posted: Tue Jan 06, 2009 11:24 am Post subject: |
|
|
mf_user,
The SEQNUM parm can be added at the end of record to count the records. Show me an example of what you are trying to do and we will try to help
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Tue Jan 06, 2009 11:25 am Post subject: |
|
|
Please give more information about what you're trying to do.
Show an example of the records in your input file and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
If you want to use a particular utility, state which utility you want to use. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Wed Jan 07, 2009 4:58 am Post subject: |
|
|
Hi,
We receive a huge file that contains successful & unsuccessful processed records. Unsuccessful record appears somewhere in the middle of file. So, want to count the records upto unsuccessful record is met.
[code:1:b2d9bb951b]
100713KKG KV1KKG2K01GNFK03087R392559....q _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12400 Topics: 75 Location: San Jose
|
Posted: Wed Jan 07, 2009 11:42 am Post subject: |
|
|
mf_user,
The following DFSORT JCL will give you the desired results. I assumed that the text 'RECORD IS NOT PROCESSED' is found in the first 23 bytes
[code:1:ccae74e26b]
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
100713KKG KV1KKG2K01GNFK03087R392559....Q _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Wed Jan 07, 2009 1:11 pm Post subject: Thank you |
|
|
Kolusu, thanks for the quick work..... It helps me. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Thu Jan 08, 2009 5:10 am Post subject: I tried it but with a failure ! |
|
|
Kolusu, I was trying to experiment to achieve the same with the use of SUM FIELDS but failed though........So, this must be the only way to reach it.
Thanks.[/code] _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12400 Topics: 75 Location: San Jose
|
Posted: Thu Jan 08, 2009 11:46 am Post subject: Re: I tried it but with a failure ! |
|
|
| mf_user wrote: | Kolusu, I was trying to experiment to achieve the same with the use of SUM FIELDS but failed though........So, this must be the only way to reach it.
Thanks.[/code] |
You sure do like to complicate things dont you? When we provide you a with solution we give you an optimal solution. There are n different ways to get the desired results. I gave you a job with a COPY operation which is highly efficient, but you wanted a job with SORT and SUM. It is totally inefficient because now you need to reformat every record and perform a sort and then sum them. Why would you even want to do that? Here is the DFSORT job which would give you the exact same results using SORT and SUM
[code:1:dd09d2b5da]
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
100713KKG KV1KKG2K01GNFK03087R392559....Q _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Jan 09, 2009 4:19 am Post subject: |
|
|
| Quote: | | Why would you even want to do that? |
I was trying to experiment and seeking your suggestion.
Thanks for your time and help. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
|
|
|