Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Single quote delimiter in parsing

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

New User


Joined: 21 Aug 2007
Posts: 32
Location: USA

PostPosted: Fri Mar 14, 2008 4:00 am    Post subject: Single quote delimiter in parsing
Reply with quote

I have a string:
DEFINE SBR NAME='SC#HOG',

I want to parse the string data such that I get SC#HOG in a separate field without quotes. Can I do this just using single PARSE VAR instruction ???
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Fri Mar 14, 2008 5:08 am    Post subject: Reply to: single quote delimiter in parsing
Reply with quote

Does this work for you?

string = "DEFINE SBR NAME='SC#HOG',"
...
Parse Var string . "'" varname "'" .

or

Parse Var string . '=' varname ',' .
varname = Strip(varname,B,"'")
Back to top
View user's profile Send private message
rohitsir

New User


Joined: 21 Aug 2007
Posts: 32
Location: USA

PostPosted: Fri Mar 14, 2008 10:52 pm    Post subject:
Reply with quote

The first approach doesn't work. I have already tried it. The second approach does work. I have done sth different to achieve it.

LEN = LENGTH(VARNAME)
VARNAME = LEFT(VARNAME,LEN - 1)
VARNAME = RIGHT(VARNAME,LEN - 2)

Thanks for the reply.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Mar 14, 2008 11:29 pm    Post subject:
Reply with quote

rohitsir wrote:
The first approach doesn't work.


Yes it does.

Code:

     3 *-* string = "DEFINE SBR NAME='SC#HOG',"       
       >L>   "DEFINE SBR NAME='SC#HOG',"               
     4 *-* Parse Var string . "'" varname "'" .       
       >.>   "DEFINE SBR NAME="                       
       >>>   "SC#HOG"                                 
       >.>   ","                                       
     5 *-* Say varname                                 
       >V>   "SC#HOG"                                 
SC#HOG                                                 
     6 *-* Exit 0                                     
       >L>   "0"                                       
Back to top
View user's profile Send private message
rohitsir

New User


Joined: 21 Aug 2007
Posts: 32
Location: USA

PostPosted: Mon Mar 17, 2008 9:50 pm    Post subject:
Reply with quote

My bad. It does work.
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 Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us