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 RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm


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