IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to count particular string using TSO command


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
csai1987

New User


Joined: 18 Jul 2011
Posts: 3
Location: chennai

PostPosted: Mon Jul 18, 2011 12:29 pm
Reply with quote

Hi!

I have string called 'male'.here i need to know how many male candiates are in this member. Thanks in Advance
[/Search]
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Mon Jul 18, 2011 12:31 pm
Reply with quote

Csai,
Your Question doesn't make sense. can you rephrase it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8798
Location: Welsh Wales

PostPosted: Mon Jul 18, 2011 12:34 pm
Reply with quote

What have YOU tried already.

This can be accomplished by a basic ISPF command.
Either in batch or foreground.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10903
Location: italy

PostPosted: Mon Jul 18, 2011 12:57 pm
Reply with quote

a badly posed question just deserves a generic reply

in ISPF browse/view/edit just issue the command ...
Code:
FIND <Yourstring> ALL

You will get back a short and long messages telling how many time the <thing> was found
Code:


 EDIT       ENRICO.ISPF.EXEC(ARGS) - 01.01                       2 WORD 'PARSE'
 Command ===>    f Parse word all                              Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 000002 /*                                                                   */
 000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 000004 Trace "O"                                                               
 000005                                                                         
 000006 Parse Source _sys _how _cmd .                                           
 000007                                                                         
 000008 Parse arg args                                                         
 000009 strdel = left(args,1)                                                   
 000010 strstr = 2                                                             
 000011 if verify(strdel,"""'","M") = 0 then do                                 
 000012    say "no starting string delimiter"                                   
 000013    exit                                                                 
 000014 end                                                                     
 000015 strend = pos(strdel,args,strstr)                                       
 000016 if strend = 0 then do                                                   
 000017    say "no ending   string delimiter"                                   
 000018     !—————————————————————————————————————————————————————!             
 000019 end ! WORD 'PARSE' - found 2 times within columns 1 to 80 !             
 000020 str !—————————————————————————————————————————————————————!             
 000021 string = substr(args,strstr,strlen)                                     
Back to top
View user's profile Send private message
csai1987

New User


Joined: 18 Jul 2011
Posts: 3
Location: chennai

PostPosted: Wed Jul 20, 2011 11:08 am
Reply with quote

Hi enrico-sorichetti,

After your valuable reply i got the good solution for my query.

Thanks
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1356
Location: Israel

PostPosted: Wed Jul 20, 2011 12:27 pm
Reply with quote

But if you have:
Code:
male
female
and you do
Code:
F 'MALE' ALL
then you have 2 hits!
So you should use:
Code:
F 'MALE' ALL WORD
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts DB2 Query to get the count of Unique ... DB2 2
No new posts USAGE parameter of RACDCERT CONNECT c... All Other Mainframe Topics 2
No new posts creat new line command in front of Me... TSO/ISPF 4
No new posts c all command JCL & VSAM 11
Search our Forums:


Back to Top