Jcl that counts the Number of members,



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Jcl that counts the Number of members,

Postby fuuss » Tue Apr 08, 2008 4:44 pm

Hey

I need some help again , I need a Jcl that counts the Number of members, based on a specified Rule.
For example I have 10 Members calles AB1,AB2,AB3,AB4,AB5,AB6 AND AC7,AC8,AC9,AC0

So I want to count the number of Members AB for exemple

I don't know if this is possible in Jcl , or maybe Rexx


thank you in advance

Fuuss
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

 

Re: Jcl that counts the Number of members,

Postby MrSpock » Tue Apr 08, 2008 6:25 pm

fuuss wrote:I don't know if this is possible in Jcl , or maybe Rexx


Either way. What's your preference?

The method is the same:

- Create the member list.
- Select only the member list records where the first two characters are 'AB'.
- Count the total number of records selected.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Jcl that counts the Number of members,

Postby fuuss » Wed Apr 09, 2008 12:50 pm

Yeah JCL is better take less Processing,

Thank for you help but I don't know really how to start.
sorry as I am really new , I don't know really where to start
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby arunprasad.k » Wed Apr 09, 2008 6:26 pm

Here is a way of doing this through REXX.

[code]
/* rexx */
say 'Enter the PDS name'
pull dsnname
say 'Enter the Starting character of the Member name'
pull member
dsnname=strip(dsnname)
member=strip(member)
dsnname ="'"||dsnname||"'"
n=0
l=length(member)
x=outtrap(out.)
address tso "LISTDS "dsnname" MEMBERS"
x=outtrap(off)
do j = 1 to out.0
if memstarted= 'y' then do
if substr(out.j,3,l) = member then do
n = n+1
say substr(out.j,3,8)
end
end
if substr(out.j,3,7) = 'MEMBERS' then do
memstarted='y'
end
end
say 'The PDS' dsnname 'has ' n 'members starting with ' member
exit

[\code]

I understand that the topic is posted in JCL forum, so I will post the solution using some utilities soon.

Before that, do you have FileAid in your shop??

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby arunprasad.k » Wed Apr 09, 2008 6:31 pm

Here is the formatted one!!

/* rexx */                                                             
  say 'Enter the PDS name'                                             
  pull dsnname                                                         
  say 'Enter the Starting character of the Member name'                 
  pull member                                                           
  dsnname=strip(dsnname)                                               
  member=strip(member)                                                 
  dsnname ="'"||dsnname||"'"                                           
  n=0                                                                   
  l=length(member)                                                     
  x=outtrap(out.)                                                       
  address tso "LISTDS "dsnname" MEMBERS"                               
  x=outtrap(off)                                                       
  do j = 1 to out.0                                                     
     if memstarted= 'y' then do                                         
        if substr(out.j,3,l) = member  then do                         
           n = n+1                                                     
           say substr(out.j,3,8)                                       
        end                                                             
     end                                                               
     if substr(out.j,3,7) = 'MEMBERS' then do                           
         memstarted='y'                                                 
     end                                                               
  end                                                                   
  say 'The PDS' dsnname 'has ' n 'members starting with ' member       
exit                                                                   
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby fuuss » Thu Apr 10, 2008 11:58 am

Ok cool thing thank you very much

is it also possible in JCL ?
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby fuuss » Thu Apr 10, 2008 2:31 pm

I just tried something is not working , he don't find anything :-)
hmm trying to find the bug
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby arunprasad.k » Thu Apr 10, 2008 4:05 pm

Ok cool thing thank you very much

You are welcome!
is it also possible in JCL ?

Possible using some utilities. Answer my question "Do you have FileAid in your shop??"
I just tried something is not working , he don't find anything
hmm trying to find the bug

What is not working for you?? Can you show us what you did and where you find problems??

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby fuuss » Thu Apr 10, 2008 4:32 pm

Ok I made a few modifications and now it is working

/* rexx */                                                                     
say 'Enter the PDS name'                                                       
pull dsnname                                                                   
say 'Enter the Starting character of the Member name'                           
pull member                                                                     
dsnname=strip(dsnname)                                                         
member=strip(member)                                                           
dsnname ="'"dsnname"'"                                                         
n=0                                                                             
l=length(member)                                                               
x=outtrap(out.)                                                                 
address tso "LISTDS "dsnname" MEMBERS"                                         
x=outtrap(off)                                                                 
do j = 7 to out.0                                                               
/*if memstarted= 'N' then do */                                                   
SAY SUBSTR(out.j,3,8)                                                           
       if substr(out.j,3,l) = member  then do                                   
           n = n+1                                                             
           Say substr(out.j,3,8)                                               
           /*memstarted='y'*/                                                   
       end                                                                     
end                                                                     
say 'The PDS' dsnname 'has ' n 'members starting with ' member         
exit                                                                                                                         


So I took out the memstarted Variable , and changed J to 7 because line 1 to 7 are where the members are stored , now it it working

For the other question , no I don't think we have fileaid , I have to ask IBM if it is installed but I don't think so
but thx again :-) already it is working in Rexx


:-)
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Jcl that counts the Number of members,

Postby arunprasad.k » Fri Apr 11, 2008 3:55 pm

Good!! Welcome!!

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post