Re: problem substituting variables

2007-05-21 Thread Shmuel Metz (Seymour J.)
In [EMAIL PROTECTED],
on 05/11/2007
   at 01:31 PM, Visser,  Hans (PinkRoccade Infrastructure
Services Technisch Specialist) 
[EMAIL PROTECTED] said:

   Why is the variable vqual2a substituted by QUAL, but vqual2b not by
the 2???

Because you used vqual2a as a tail but used vqual2 as a stem.

   I like to have following result QUAL1.QUAL2.QUAL3.
   How could that be reached???

varvalue = QUAL1.vqual2a||vqual2b'.'QUAL3

Assuming that you haven't used QUAL1. as a stem. Otherwise try

varvalue = QUAL1'.'vqual2a||vqual2b'.'QUAL3

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see http://patriot.net/~shmuel/resume/brief.html 
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Hardee, Charles H
Try this for your line 8 statement:

varvalue=QUAL1.vqual2a||vqual2b.QUAL3

With the above, I get:

  4 *-* vqual2a='QUAL' 
  5 *-* vqual2b='2'
  6 *-* varvalue=QUAL1.vqual2a||vqual2b.QUAL3  
  7 *-* interpret varvalue=varvalue  
*-*  varvalue=QUAL1.QUAL2.QUAL3
  8 *-* say vqual2b
 2 
  9 *-* exit   
 ***   

Is this what you are looking for?

Chuck

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Visser, Hans (PinkRoccade Infrastructure Services Technisch
Specialist)
Sent: Friday, May 11, 2007 6:31 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: problem substituting variables

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Veilleux, Jon L
Try this:

inp=LIB  SDSNCLST   [EMAIL PROTECTED] 
gprclient = PRI
gprsms=B   
parse var inp . varname varval .   
parse var varval  part1 '.' part2 '@' part3 '.' part4  
newvar = part1||'.'||gprclient||gprsms||'.'||part4 
say newvar  


Jon L. Veilleux
[EMAIL PROTECTED]
(860) 636-2683 

This e-mail may contain confidential or privileged information. If
you think you have received this e-mail in error, please advise the
sender by reply e-mail and then delete this e-mail immediately.
Thank you. Aetna

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Hardee, Charles H
Hans,

Try this:

/* REXX */

arg debugopt

if debugopt = DEBUG then trace all

 

iobuff = LIB  SDSNCLST   [EMAIL PROTECTED]

 

parse var iobuff . varname varvalue .

 

say variable name: varname

say Variable Valu: varvalue

 

dsn. = 

dsn.0 = 0

do forever

   parse var varvalue dsnqual.varvalue

   if dsnqual =  then leave

   dsn# = dsn.0 + 1

   dsn.dsn# = dsnqual

   dsn.0 = dsn#

   if pos(@,dsnqual)  0 then sub# = dsn#

   end

 

varvalue = '

do i = 1 to dsn.0

   dsnqual = dsn.i

   if i /= sub# then varvalue = varvalue||dsnqual.

   else do

  ll = pos(@,dsnqual)-1

  rl = length(dsnqual)-ll-1

  varvalue = varvalue'left(dsnqual,ll)||right(dsnqual,rl)'.

  end

   end

 

if right(varvalue,1) = . then varvalue =
left(varvalue,length(varvalue)-1)
varvalue = varvalue'

 

gprclient = PRI

gprsms= B

 

interpret varvalue = varvalue

 

say varvalue = varvalue

 

exit


Chuck

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Visser, Hans (PinkRoccade Infrastructure Services Technisch
Specialist)
Sent: Friday, May 11, 2007 7:22 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: problem substituting variables

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Don Maxwell
snip
To be precisely, i read a record from a file which f.i. contains
following information:

LIB  SDSNCLST   [EMAIL PROTECTED]
(That @ may be any character if you like)

gprclient contains PRI.
gprsms contains B.

So i read that record and parse it.

PARSE VAR record . varname varvalue .

Then the result i want to have is DSN810.PRIB.SDSNCLST.

I have tried several INTERPRET statements and used the VALUE keyword
many times, but i don't what i want.

The record has to be specified as simple as possible, so without
several quotes or double quotes.

/snip


The following REXX code should give you the results you require:

/* rexx */  
teststring = LIB  SDSNCLST   [EMAIL PROTECTED] 
gprsms = B
gprclient = PRI   
parse value teststring with . varname varvalue .
parse value varvalue with first . gpr1 @ gpr2 . . 
interpret gpr3=gpr1   
interpret gpr4=gpr2   
say first.gpr3||gpr4||.||varname


The output is:

DSN810.PRIB.SDSNCLST  

I do not know of a way to do the required parsing/interpreting without
quotes


Regards, 
 
Don Maxwell, B. Math, EDP
Crawford Technologies Support
Tel: (416) 410-1467 ext 208
Email:  [EMAIL PROTECTED]
Web:   www.crawfordtech.com

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Paul Gilmartin
On Fri, 11 May 2007 14:22:15 +0200, Visser, Hans (PinkRoccade Infrastructure 
Services Technisch Specialist) wrote:

   the result is what i am looking for, but the way you do it is 'not 
 possible'.
   [ ... ]
   The record has to be specified as simple as possible, so without 
 several quotes or double quotes.

I am reminded of a statement attributed to Einstein:

Our description of the universe should be as simple as
possible, but no simpler.

If the simplest solution to the problem involves several quotes or
double quotes, then nothing simpler is correct.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: problem substituting variables

2007-05-11 Thread Visser, Hans (PinkRoccade Infrastructure Services Technisch Specialist)
I've done as i should have done it in a CLIST.

LIB  SDSNCLST   DSN810.GPRCLIENT.GPRSMS..SDSNCLST



 PARSE VAR parms.ssindex . varname varvalue .   
/**/
 DO WHILE POS('',varvalue)  0 
PARSE VAR varvalue varvalue1 '' varvalue2 '.' varvalue3
/**/
varvalue = varvalue1||VALUE(varvalue2)||varvalue3   
 END
  END   
/**/


Thank you all for your time.
Especially Paul Gilmartin for his brilliant contribution. :-)

regards,

Hans Visser

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html