MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

count records until some condition met

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Jan 06, 2009 4:07 am    Post subject: count records until some condition met Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Tue Jan 06, 2009 11:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 06, 2009 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Jan 07, 2009 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Wed Jan 07, 2009 11:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Jan 07, 2009 1:11 pm    Post subject: Thank you Reply with quote

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
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Jan 08, 2009 5:10 am    Post subject: I tried it but with a failure ! Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Thu Jan 08, 2009 11:46 am    Post subject: Re: I tried it but with a failure ! Reply with quote

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? bonk 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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Jan 09, 2009 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group