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
 

 

To find the number of occurance

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vasan_4u

New User


Joined: 28 Jun 2005
Posts: 35
Location: chennai

PostPosted: Tue Jan 15, 2008 2:10 am    Post subject: To find the number of occurance
Reply with quote

I need to find the number of occurance of '&' in this string.

'&HLQV&VER&SYS..POST20.TEMP.LTRQ.CLUSTER'

Is there any command available or can any one help me in doing it.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Jan 15, 2008 2:48 am    Post subject: Reply to: To find the number of occurance
Reply with quote

Code:

/* REXX */
thevar = '&HLQV&VER&SYS..POST20.TEMP.LTRQ.CLUSTER'
cnt = 0
Do n = 1 To Length(thevar)
  If Substr(thevar,n,1) = '&' Then cnt = cnt + 1
End
Say cnt

thevar = Translate(thevar,' ','&')
Say Words(thevar)
Exit
Back to top
View user's profile Send private message
vasan_4u

New User


Joined: 28 Jun 2005
Posts: 35
Location: chennai

PostPosted: Tue Jan 15, 2008 8:29 pm    Post subject:
Reply with quote

thank you very much ...
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm


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