Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to count particular string using TSO command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to count particular string using TSO command
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    Post subject: Reply to: How to count particular string using TSO command
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jul 18, 2011 12:34 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Mon Jul 18, 2011 12:57 pm    Post subject: Reply to: How to count particular string using TSO command
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    Post subject: Hi
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: 1228
Location: Israel

PostPosted: Wed Jul 20, 2011 12:27 pm    Post subject: Reply to: How to count particular string using TSO command
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us