View previous topic :: View next topic
|
Author |
Message |
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
Hi,
I have a requirement where i need to count the number of records in a VSAM file where the status is 'Active' and i will specify the starting postition from where the JCL should start counting the number of records which are in Active status thru JCL parm card or thru SET statement.
my VSAM file will be like this
s.no Name roll# status
1 aaa 001 Active
2 bbbb 002 Not Active
3 cccc 003 Active
4 aaa 004 active
5 aaa 005 Active
6 bbbb 006 Not Active
7 cccc 007 Active
8 aaa 008 active
Say for example, i need to get the no. of records which are in active status and my read should start from 4th position.
And for this example my output should be 4.
Thanks in advance,
Regards,
Anand |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
And for this example my output should be 4. |
Why?
What is "from 4th position"?
Are these records "freeform" or are the field displacements fixed in the records? |
|
Back to top |
|
|
anandkumarrn
New User
Joined: 06 Feb 2009 Posts: 23 Location: India
|
|
|
|
Quote: |
And for this example my output should be 4. |
Why?
What is "from 4th position"?
Hi d.sch. thanks for your quick reply,
The output i said was for the above example, where there are 4 active records after my 4th(s.no). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Show the actual format of the records (this probably means you need to use the "Code" tag to preserve alignment). Does "A/active" always appear at the same displacement?
It is a fairly bad idea to provide sample data where the "answer" is used in the question (i.e. "4").
What determines the starting s.no? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi Anand,
From the data
Code: |
1 aaa 001 Active
2 bbbb 002 Not Active
3 cccc 003 Active
4 aaa 004 active
5 aaa 005 Active
6 bbbb 006 Not Active
7 cccc 007 Active
8 aaa 008 active |
this
seems to be the fourth position and if this is true, if we count from this position (including 4th) there are total "4 occurences" of word "active" till we reach "8th position" and 8th position in exapmle is
Now how this
Quote: |
my read should start from 4th position |
is decided? What are the other possibe values "to start"? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
My goal was to get the TS to do a better job of posting a requirement - there was no question of the meaning. It was simply poorly done. What you "coded" may or may not be the way the data is actually present in the file. . . Which is why i questioned the format/displacement of the data.
Whatever lead to posting an example where the 4th record, the 4th field in the data, and a desired output of 4 is a mystery.
[PesonalBelief]
One of the most valuable things we can do for the forum members is to guide in how to properly post a question/requirement. If we encourage people to refine their posts we do them a service. If we flail away at ambiguous questions with best-guess "solutions" we do them a disservice (not counting usually wasting a lot of time to get to a solution they can use).
[/PersonalBelief] |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I've stopped suggesting people read the manual (even provide a link),
'cause someone always comes along and uses forum space to quote the manual,
or
provide an answer to a syntax question. |
|
Back to top |
|
|
|