Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to count the number of records thru JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
anandkumarrn

New User


Joined: 06 Feb 2009
Posts: 23
Location: India

PostPosted: Sat May 23, 2009 11:57 pm    Post subject: Need to count the number of records thru JCL
Reply with quote

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun May 24, 2009 12:03 am    Post subject:
Reply with quote

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
View user's profile Send private message
anandkumarrn

New User


Joined: 06 Feb 2009
Posts: 23
Location: India

PostPosted: Sun May 24, 2009 12:11 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun May 24, 2009 1:37 am    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun May 24, 2009 1:07 pm    Post subject:
Reply with quote

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
Quote:
4 aaa 004 active
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
Quote:
8 aaa 008 active


Now how this
Quote:
my read should start from 4th position
is decided? What are the other possibe values "to start"?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun May 24, 2009 11:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon May 25, 2009 1:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us