View previous topic :: View next topic
|
Author |
Message |
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
Hi all,
can any one assist me is it possible to count no of records in a dataset through IDCAMS utility or some other utility.
my requirement is : At first step my utility pgm must check no of records in a dataset, if it is more than one than only next step must execute. so kindly assist me. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Veena,
Following step returns '4', if the no of records are greater than 1 and '0' if the record count is equal to 1.
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT DD * <-- I/P file
004102007 PGM1
004102007 PGM1
/*
//TOOLIN DD *
COUNT FROM(INPUT) HIGHER(1) RC4
/* |
|
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
First I would like to thanks for reply, can we set multiple conditions in this (TOOLIN DD *) for ex: empty, single record & and with mandatory record types with different Return codes. Kindly help me in this regard
//TOOLIN DD *
COUNT FROM(INPUT) HIGHER(1) RC4
/* |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Veena,
Quote: |
empty, single record & and with mandatory record types with different Return codes |
We can verify empty file. Single you know it already. What do you mean by mandatory record types? |
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
murali,
could you please tell me for the condition on empty and for single record, In the mean time i will draft details indetail. Note : all these conditions must be executed in the single step with return codes |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Veena,
Your requirement is not clear. Is it like verify the same file for EMPTY, ONE record. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
yes murali exactly
with in the same toolin dd * can i write more than on condition like below with different return code.
COUNT FROM(INPUT) HIGHER(1) RC4
if so kindly provide me the details and also can you pleas give me best & fast reference material in ICETOOL |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Veena,
Quote: |
with in the same toolin dd * can i write more than on condition like below with different return code. |
File empty and non-empty conditions are contradicting. Its a bad idea to verify same file for these conditions.
Anyways Krisprems had given the link. Verify that.
Quote: |
so kindly provide me the details and also can you pleas give me best & fast reference material in ICETOOL |
Sticky's are available in DFSORT forum for ref materials. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Code: |
//*******************************************************
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT DD *
DAFDF
DAFDF
/*
//TOOLIN DD *
*SET RC=12 IF I/P IS EMPTY
COUNT FROM(INPUT) EMPTY
*SET RC=04 IF I/P HAS MORE THAN ONE RECORD
COUNT FROM(INPUT) HIGHER(1) RC4
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
veena_nagesh2002,
Note that DFSORT's ICETOOL will return the highest return code it sets as the return code of the job. So if it sets RC=12 for one operator and RC=4 for another operator, the return code for the job will be 12. Also note that once ICETOOL sets RC=12 for an operator it will stop executing the remaining operators unless you use MODE CONTINUE.
It's still not clear to me exactly what you want to do. Perhaps if you explained it in more detail, I could help you figure out how to do what you want to do. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
veena_nagesh2002 wrote: |
my requirement is : At first step my utility pgm must check no of records in a dataset, if it is more than one than only next step must execute. so kindly assist me. |
This quote from your first post suggest that you want to check for empty/non-empty file.
But this
Quote: |
could you please tell me for the condition on empty and for single record, |
is bit confusing..one record or many..file is not empty, what are you lokking for?
I think, you need to do somthing like:
Code: |
if one-record-in-input
do this
else-if two-records
do this
else-if
do this
end-if. |
If so..don't you think that it's a bit prgramatic approach rather than JCL one. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
FWIW, i'd suggest looking at the design and implementing a consistent procedure that is not sensitive to zero, one, many, or record-types in "the file".
Even when this is all "working", i suspect it will be met with problems when it is in maintenance or needs to be "enhanced". I'm also not sure if there might be restart "opportunities" as well.
Many systems have met whatever this business requirement is without needing to use this method. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
dick scherrer wrote: |
Many systems have met whatever this business requirement is without needing to use this method. |
I suspect that it can be a business requirement , however if yes..would like to know a bit about such a system, even via PM. |
|
Back to top |
|
|
ayansau
New User
Joined: 22 Jun 2007 Posts: 42 Location: Chennai
|
|
|
|
I want number of records present in a file.. Not to check an empty file... |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
ayansau,
Quote: |
I want number of records present in a file.. Not to check an empty file... |
Any reason for not starting a 'new topic'.
This was discussed earlier. Search DFSORT forum.
Clue: Searchword - 'trailer1'. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
pdevidas12
New User
Joined: 28 Feb 2010 Posts: 3 Location: Pune
|
|
|
|
Me too have same requirment, please let me know if you have got the solition? |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
pdevidas12,
Quote: |
Me too have same requirment |
Please define/provide your requirements clearly.
If its the "same" requirement then the "same" solution should work for you. Above comments from Frank applies to you as well, you should have started new topic.
Thanks, |
|
Back to top |
|
|
|