Re: CLIST question (the ampersands are killing me)

2007-05-16 Thread Paul Gilmartin
On Tue, 15 May 2007 20:51:56 -0300, Shmuel Metz (Seymour J.) wrote:
>
>You can invoke a CMS EXEC or EXEC2 procedure from within CMS EDIT, but
>if you invoke EDIT from within an EXEC then it loses control until
>EDIT completes. There is no equivalent to DATA and DATA PROMPT.
>
My recollection differs, though I may well be confusing CMS EXEC with
CLIST.  Regardless, it's now moot: the only hit I get for EDIT * * is:

 EDIT EXEC S2  V 133  Trunc=133 Size=75 Line=0 Col=1 Alt=0

**
*
* @VR5HNKW - Remove call to old EDIT since 370 machines are not
*supported in VM/ESA 1.3.0.
*
*THIS  EXEC  IS   USED  TO   INVOKE  XEDIT   IN   EDIT
*COMPATIBILITY MODE.

>>But you must accept not receiving status from the stacked commands
>
>Correct. This is one of the few cases where CLIST is superior to REXX.
>
The only such modal behavior I now know in Rexx is with the new-fangled
(z/OS 1.4) "address 'TSO'" in Rexx EXECs invoked from a UNIX shell.
But, it proves the concept provided developers were diligent, and at
least one z/OS Unix developer was so diligent.

-- 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: CLIST question (the ampersands are killing me)

2007-05-16 Thread Shmuel Metz (Seymour J.)
In <[EMAIL PROTECTED]>, on 05/11/2007
   at 06:05 PM, Paul Gilmartin <[EMAIL PROTECTED]> said:

>Actually, CMS EXEC supports the same modal interaction with CMS EDIT
>as CLIST with TSO EDIT.

You can invoke a CMS EXEC or EXEC2 procedure from within CMS EDIT, but
if you invoke EDIT from within an EXEC then it loses control until
EDIT completes. There is no equivalent to DATA and DATA PROMPT.

>But you must accept not receiving status from the stacked commands

Correct. This is one of the few cases where CLIST is superior to REXX.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
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: CLIST question (the ampersands are killing me)

2007-05-11 Thread Paul Gilmartin
On Fri, 11 May 2007 17:51:04 -0300, Shmuel Metz (Seymour J.) wrote:

>In <[EMAIL PROTECTED]>, on 05/10/2007
>   at 09:36 AM, Paul Gilmartin said:
>
>>Rexx, however, lacks the modal dialog facility of CLIST.
>>I wonder why?
>
>Because CMS didn't use the same stack model as TSO.
>
Actually, CMS EXEC supports the same modal interaction with
CMS EDIT as CLIST with TSO EDIT.  I'd call the models isomorphic.
Their various successors, EXEC2, Rexx, XEDIT, Rexx, and ISPF
abandoned the capability.  But ISTR some evidence that XEDIT
stacks and pulls each command before performing it.

>>Is it possible to usefully drive TSO EDIT with Rexx?
>
>Use push and/or queue before calling EDIT.
>
But you must accept not receiving status from the stacked
commands (except possibly the last).

>>Why would one want to?
>
>Basic editing while not under ISPF.
>
Sorry; that was rhetoric, not requiring an answer.

-- 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: CLIST question (the ampersands are killing me)

2007-05-11 Thread Shmuel Metz (Seymour J.)
In <[EMAIL PROTECTED]>, on 05/10/2007
   at 02:21 PM, David Eisenberg <[EMAIL PROTECTED]> said:

>I appreciate the CLIST information you provided in your post, but I
>don't  understand why you have accused me of being a liar

That's good, because I didn't. You're simply uninformed as to what BAL
is.

>This is the first time I've posted to IBM-MAIN, but it surely won't
>be the  last.

This is a useful resource. Welcome.

Note; there is an archive, which is sometimes very useful.

>I guess I could have e-mailed John Ehrman at IBM directly to get the
>answer,  but that didn't seem appropriate. He has helped me enough
>with BAL-related  issues,

No. See below. BTW, we owe John a huge debt for his efforts in moving
most of the "SLAC enhancements" into the mainstream.

>and CLIST isn't BAL.

Neither is HLA.

>I am a 46-year-old, 23-year veteran BAL programmer,

23 years ago, BAL was long gone. BAL was part of BPS[1], which only
saw a few years of significant use, in the 1960's.

>Any particular reason that you've accused me of being a liar

I haven't. Had I believed that you were a liar, which I don't, I would
have said so.

[1] In the context of S/360; the name was also used on one of a
kind machines that could not[2] run normal S/360 software.

[2] Except for the 360/44 with the Commercial Instruction Set
Feature, where code to simulate the missing instructions
ran from shadow memory.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
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: CLIST question (the ampersands are killing me)

2007-05-11 Thread Shmuel Metz (Seymour J.)
In <[EMAIL PROTECTED]>, on 05/10/2007
   at 02:46 PM, David Eisenberg <[EMAIL PROTECTED]> said:

>So I'm a HLASM programmer. But for the record, whatever language it
>is, I  learned it originally in 1980 from the Struble text (it might
>have been the first edition).

I'd guess Assembler (H), but it might have been Assembler (XF).
Assembler (XF) was bundled with OS/VS1, OS/VS2 and VM, while Assembler
(H) was chargeable.

>Was that BAL?

No.

> I doubt it was HLASM..

Definitely not; HLA came later, as the replacement for Assembler (H)
Version 2.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
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: CLIST question (the ampersands are killing me)

2007-05-11 Thread Shmuel Metz (Seymour J.)
In <[EMAIL PROTECTED]>, on 05/10/2007
   at 09:36 AM, Paul Gilmartin <[EMAIL PROTECTED]> said:

>Rexx, however, lacks the modal dialog facility of CLIST.

>I wonder why?

Because CMS didn't use the same stack model as TSO.

>Is it possible to usefully drive TSO EDIT with Rexx?

Use push and/or queue before calling EDIT.

>Why would one want to?

Basic editing while not under ISPF.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
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: CLIST question (the ampersands are killing me)

2007-05-11 Thread Chase, John
> -Original Message-
> From: IBM Mainframe Discussion List On Behalf Of Arthur T.
> 
> [ snip ]
> 
>   Meanwhile, in normal conversation, I'll talk about the 
> OS as MVS; I'll look things up on my green card; and I'll use 
> the term ALP, BAL, HLASM, or Assembler, whichever is 
> convenient at the time.

You might want to include "ALC" in this context as well.

-jc-

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Arthur T.
On 10 May 2007 13:32:24 -0700, in bit.listserv.ibm-main 
(Message-ID:<[EMAIL PROTECTED]>) 
[EMAIL PROTECTED] (Gerhard Postpischil) wrote:


BAL stands for Basic Assembler Language, and at most 
installations it didn't survive into the seventies. 
Current assemblers are about three generations removed.


You state that you came here for help, but the quality of 
the help you receive is proportional to the amount and 
reliability of information you provide. I can just see a 
professional chemist complete a job application saying he 
practices Alchemy. 


 And yet, someone told me recently about missing a job 
opening because he claimed ALP and HLASM, but their HR 
person searched for BAL.  Make sure you have *all* of the 
synonyms (or near-synonyms) in your resumes.


 Meanwhile, in normal conversation, I'll talk about 
the OS as MVS; I'll look things up on my green card; and 
I'll use the term ALP, BAL, HLASM, or Assembler, whichever 
is convenient at the time.  And, apparently unlike some 
people here, I consider IBM-Main to be "normal 
conversation".  Exact phrasing is needed in stating a 
problem or a solution, but anything else in a post should 
not be held to the same level of precision.  Some hairs 
should be split; some shouldn't.  I hope that none of you 
who objected to BAL ever use the word "brontosaurus" (which 
I still do without apologies).



--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" 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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
>We all know what you mean, David, but a few of us tend to prefer the terms 
that are technically correct.<

I see that!

Mea maxima culpa. I'll be more careful next time...

David

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Rick Fochtman

David Eisenberg wrote:

I doubt it; in fact, I doubt that you're old enough to have ever seen BAL. 
   


And you're certainly not using it on z/OS.<

I appreciate the CLIST information you provided in your post, but I don't 
understand why you have accused me of being a liar when I came here for 
help. This is the first time I've posted to IBM-MAIN, but it surely won't be the 
last.


I guess I could have e-mailed John Ehrman at IBM directly to get the answer, 
but that didn't seem appropriate. He has helped me enough with BAL-related 
issues, and CLIST isn't BAL.


I am a 46-year-old, 23-year veteran BAL programmer, on z/OS. I've seen 
many of your posts, and have no reason to doubt anything you say. Any 
particular reason that you've accused me of being a liar on a public listserv 
without knowing anything about me?
 


---
We all know what you mean, David, but a few of us tend to prefer the 
terms that are technically correct.


I started with a system called 44/PS, in 1970, with BAL and we thought 
it was manna from heaven

when we installed a true macro assembler.

Nobody is actually calling you a liar, but a few will correct your terms 
to be "literally correct" at times.


Leave us pour oil on troubled waters.

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Gerhard Postpischil

David Eisenberg wrote:
I doubt it; in fact, I doubt that you're old enough to have ever seen BAL. 

And you're certainly not using it on z/OS.<

I appreciate the CLIST information you provided in your post, but I don't 
understand why you have accused me of being a liar when I came here for 
help. This is the first time I've posted to IBM-MAIN, but it surely won't be the 
last.


BAL stands for Basic Assembler Language, and at most 
installations it didn't survive into the seventies. Current 
assemblers are about three generations removed.


You state that you came here for help, but the quality of the 
help you receive is proportional to the amount and reliability 
of information you provide. I can just see a professional 
chemist complete a job application saying he practices 
Alchemy. 




Gerhard Postpischil
Bradford, VT

new e-mail address: gerhardp (at) charter (dot) net

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
>I think he was picking on BAL because in some contexts that refers to an old 
Assembler and is therefore not accurate for our context.<

Right... someone else said the same thing.

So I'm a HLASM programmer. But for the record, whatever language it is, I 
learned it originally in 1980 from the Struble text (it might have been the 
first 
edition). Was that BAL? I doubt it was HLASM...

David

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Steve Comstock

David Eisenberg wrote:
I doubt it; in fact, I doubt that you're old enough to have ever seen BAL. 


And you're certainly not using it on z/OS.<

I appreciate the CLIST information you provided in your post, but I don't 
understand why you have accused me of being a liar when I came here for 
help. This is the first time I've posted to IBM-MAIN, but it surely won't be the 
last.


I guess I could have e-mailed John Ehrman at IBM directly to get the answer, 
but that didn't seem appropriate. He has helped me enough with BAL-related 
issues, and CLIST isn't BAL.


I am a 46-year-old, 23-year veteran BAL programmer, on z/OS. I've seen 
many of your posts, and have no reason to doubt anything you say. Any 
particular reason that you've accused me of being a liar on a public listserv 
without knowing anything about me?


David


Shmuel can be very irritating because he is a literalist and
a nitpicker. I think he was picking on BAL because in some
contexts that refers to an old Assembler and is therefore
not accurate for our context. Most of us knew you were using
the common usage of BAL as shorthand for Assembler. (I think
BAL was Basic Assembler Language and had no macro capability
or such; before my time, but Shmuel was there, presumably.)

Anyway, I shouldn't put words in his mouth, but that is my
take on his response.

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

  z/OS Application development made easier
* Our classes include
   + How things work
   + Programming examples with realistic applications
   + Starter / skeleton code
   + Complete working programs
   + Useful utilities and subroutines
   + Tips and techniques

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
>I doubt it; in fact, I doubt that you're old enough to have ever seen BAL. 
And you're certainly not using it on z/OS.<

I appreciate the CLIST information you provided in your post, but I don't 
understand why you have accused me of being a liar when I came here for 
help. This is the first time I've posted to IBM-MAIN, but it surely won't be 
the 
last.

I guess I could have e-mailed John Ehrman at IBM directly to get the answer, 
but that didn't seem appropriate. He has helped me enough with BAL-related 
issues, and CLIST isn't BAL.

I am a 46-year-old, 23-year veteran BAL programmer, on z/OS. I've seen 
many of your posts, and have no reason to doubt anything you say. Any 
particular reason that you've accused me of being a liar on a public listserv 
without knowing anything about me?

David

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Shmuel Metz (Seymour J.)
In <[EMAIL PROTECTED]>, on 05/10/2007
   at 03:36 AM, David Eisenberg <[EMAIL PROTECTED]> said:

>I have inherited responsibility for a CLIST; this is not my forte.
>I'm trying to do  something pertaining to the ampersand character,
>and despite my efforts, I  cannot figure this out. As God is my
>witness, this is not a homework  assignment (I'm a BAL programmer, 

I doubt it; in fact, I doubt that you're old enough to have ever seen
BAL. And you're certainly not using it on z/OS.

>The problem: I want each of the tokens in the generated string to be
> preceded by a double-ampersand.

Ouch! Ampersand handling in CLIST was bad enough before they
"improved" it in OS/VS2 Release 3.6! These days it can be tricky to
figure out how many ampersands you need, and tedious to type them.

>E.g., if the user enters "ACB", I want X to 
>be set to "&&OPTA &&OPTC &&OPTB".

Isn't that HTML syntax rather than CLIST syntax? Shouldn't that be
"&&.OPTA &&.OPTC &&.OPTB"? Did you really want the letters
"amp" in the output, or did you intend to have a variable with the
name & and the value &? If the latter, didn't you want &.&
rather than &&?

>I have read the manuals, I have tried everything I can think of...
>but the  ampersands have laid me low. Any help would be greatly
>appreciated.

Have you read the documentation on "no rescan"? It will still be ugly,
but that should help. Pewrsonally, I'd rather do it in REXX.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Tim Cardozo


I have inherited responsibility for a CLIST; this is not 
>my forte. I'm
>trying to do something pertaining to the ampersand 
>character, and despite my
>efforts, I cannot figure this out. As God is my witness, 
>this is not a

>homework assignment (I'm a BAL programmer, not a sysprog).
>
>I've carved out and simplified the relevant portion of the 
>CLIST for

>perusal:
>
>WRITENR ===>
>READ L
>DO &K=1 TO &LENGTH(&L)
>   IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
>   ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
>   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC
>END
>WRITE &X
>
> ...

Replace your DO-loop and the WRITE statement with the following:

DO &K=1 TO &LENGTH(&L)
  IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&NRSTR(&X)) &NRSTR(&&OPTA)
  ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&NRSTR(&X)) &NRSTR(&&OPTB)

  ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&NRSTR(&X)) &NRSTR(&&OPTC)
END 
WRITE &NRSTR(&X)   

See the TSO/E CLISTS manual for more information on &NRSTR. 



Tim Cardozo
State of California, Franchise Tax Board

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Paul Gilmartin
On Thu, 10 May 2007 08:10:02 -0600, Howard Brazee wrote:

>On Thu, 10 May 2007 07:48:19 -0400, Dan Espen wrote:
>
>>Take my advice.
>>
>>Change the CLIST to REXX.
>>
>>It's not all that hard.  There is a rexx equivalent for every CLIST
>>operation and the bulk of the conversion is rote.
>>You'll be happy you did.
>
>Rexx is much closer to the type of programming I have done elsewhere.
>It seems like programming.   CLISTS seem like guessing how to tell TSO
>what I want.
>
Mostly true.

Rexx, however, lacks the modal dialog facility of CLIST.

I wonder why?

Is it possible to usefully drive TSO EDIT with Rexx?

Why would one want to?

-- 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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Howard Brazee
On Thu, 10 May 2007 07:48:19 -0400, Dan Espen
<[EMAIL PROTECTED]> wrote:

>Take my advice.
>
>Change the CLIST to REXX.
>
>It's not all that hard.  There is a rexx equivalent for every CLIST
>operation and the bulk of the conversion is rote.
>You'll be happy you did.

Rexx is much closer to the type of programming I have done elsewhere.
It seems like programming.   CLISTS seem like guessing how to tell TSO
what I want.

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
&NRSTR did the trick!

Thank you so much, everyone!!!

David

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Steve Comstock

Lizette Koehler wrote:

I believe there a choice here for CLIST.  That is NRSTR rather than STR.  If
you look in the TSO/E CLIST manual you will find a section on Preserving the
Double Ampersand.


&NRSTR prevents more than one level of substitution on a variable;
&STR prevents evaluation of expressions
&SYSSCAN can be used to set the number of levels of symbolic
substitution, including a value of 0, which suppresses
substitution completely until you reset it
&SYSNSUB works like &SYSSCAN for a single expression



I seem to recall that there is another function in CLIST that controls the
number of times a variable is interpreted, but I drawing a blank at the
moment as to what that is.

Lizette


   Snip


WRITENR ===>
READ L
DO &K=1 TO &LENGTH(&L)
   IF &SUBSTR(&K,&L)=A THEN SET &X=&X OPTA
   ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&X OPTB
   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&X OPTC END WRITE &X

..
.---  Unsnip




Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

  z/OS Application development made easier
* Our classes include
   + How things work
   + Programming examples with realistic applications
   + Starter / skeleton code
   + Complete working programs
   + Useful utilities and subroutines
   + Tips and techniques

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Paul Gilmartin
On Thu, 10 May 2007 05:22:53 -0500, David Eisenberg wrote:

>   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) 
> &&&&OPTC<
> ^   ^^^
>
Darren, is this a bug in entity conversion by LISTSERV, or did
did the submitter post it that way?

>I've tried things like that; it is absolutely not that simple. I just tried 
>this
>solution; it sets X to a single ampersand concatenated only to the last
>expression. For example, if the user enters "ABC", the result is "&OPTC".
>
>There's something more to it than just doubling the ampersands.
>
CLIST's infernal iterative substitution.

On the first iteration, "OPTC" becomes "&&OPTC"
On the second iteration, "&&OPTC" becomes "&OPTC".
You always wind up with just one "&".

Anyone wonder why I prefer Rexx?

-- 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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Walt Farrell

On 5/10/2007 6:22 AM, David Eisenberg wrote:

So, as you want 2 ampersands you need to use 4, and thus I suggest trying:

   IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
   ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC<

I've tried things like that; it is absolutely not that simple. I just tried this 
solution; it sets X to a single ampersand concatenated only to the last 
expression. For example, if the user enters "ABC", the result is "&OPTC".


There's something more to it than just doubling the ampersands.


You're right; sorry.  That will work for the first assignment, but not 
the subsequent times.  Lizette's idea of using &NRSTR or &SYSNSUB is 
probably what you need.


... THEN SET &X = &SYSNSUB(1,&X) OPTA
or possibly
... THEN SET &X = &SYSNSUB(1,&X) &NRSTR(&&OPTA)

See 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4B840/6.13?SHELF=EZ2ZO10I&DT=20060627214234 
or http://preview.tinyurl.com/2gkwe8


and 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4B840/6.5?SHELF=EZ2ZO10I&DT=20060627214234

or http://preview.tinyurl.com/224965

Walt Farrell, CISSP
z/OS Security Design, IBM

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Lizette Koehler
I believe there a choice here for CLIST.  That is NRSTR rather than STR.  If
you look in the TSO/E CLIST manual you will find a section on Preserving the
Double Ampersand.

I seem to recall that there is another function in CLIST that controls the
number of times a variable is interpreted, but I drawing a blank at the
moment as to what that is.

Lizette


   Snip


WRITENR ===>
READ L
DO &K=1 TO &LENGTH(&L)
   IF &SUBSTR(&K,&L)=A THEN SET &X=&X OPTA
   ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&X OPTB
   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&X OPTC END WRITE &X

.
.---  Unsnip

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Steve Comstock

David Eisenberg wrote:

[excerpts from original post:

WRITENR ===>
READ L
DO &K=1 TO &LENGTH(&L)
  IF &SUBSTR(&K,&L)=A THEN SET &X=&X OPTA
  ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&X OPTB
  ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&X OPTC
END
WRITE &X

.
.
.

The problem: I want each of the tokens in the generated string to be
preceded by a double-ampersand. E.g., if the user enters "ACB", I want X to
be set to "&&OPTA &&OPTC &&OPTB".

-


Follow up to my original post: the ampersands seem to have nailed me even in 
my previous message. To clarify (I hope this shows up correctly): if the user 
enters


ABC

the CLIST should produce

&&OPTA &&OPTB &&OPTC

I.e., two ampersand characters concatenated to the relevant string (e.g., 
OPTA), followed by a blank, then the same thing repeated for the next input 
character, etc.


I'm sorry for any confusion!

David


OK, I'll have a go.

Option 1: use &STR:

IF &SUBSTR(&K,&L)=A THEN SET X=&STR(&&OPTA)

-- note: do not need the & on the left hand side
   of an assignment; makes it easier to read --



Option 2: use &SYSNSUB:

IF &SUBSTR(&K,&L)=A THEN SET X=&SYSNSUB(0,&&OPTA)


Try 'em; see if either (or both) don't give you what
I think your after.



We're one of the few companies around still teaching
CLIST, so if you have to code or maintain CLISTs and
have only had OJT, consider scheduling our 3 day
class "TSO CLIST Programming in z/OS"; this is also
the only place I know where you can get any hands on
training in the TSO EDIT command. Details at:
http://www.trainersfriend.com/TSO_Clist_REXX_Dialog_Mgr/a650descrpt.htm




Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

  z/OS Application development made easier
* Our classes include
   + How things work
   + Programming examples with realistic applications
   + Starter / skeleton code
   + Complete working programs
   + Useful utilities and subroutines
   + Tips and techniques

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
>So, as you want 2 ampersands you need to use 4, and thus I suggest trying:
   IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
   ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
   ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC<

I've tried things like that; it is absolutely not that simple. I just tried 
this 
solution; it sets X to a single ampersand concatenated only to the last 
expression. For example, if the user enters "ABC", the result is "&OPTC".

There's something more to it than just doubling the ampersands.

David

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread Walt Farrell

On 5/9/2007 9:50 PM, David E. wrote:
I have inherited responsibility for a CLIST; this is not my forte. I'm 
trying to do something pertaining to the ampersand character, and despite my 
efforts, I cannot figure this out. As God is my witness, this is not a 
homework assignment (I'm a BAL programmer, not a sysprog).


I've carved out and simplified the relevant portion of the CLIST for 
perusal:


WRITENR ===>
READ L
DO &K=1 TO &LENGTH(&L)
  IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
  ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
  ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC
END
WRITE &X

The CLIST above works, and the concept is simple. The user is prompted to 
enter a string of characters chosen from the letters A, B, and C, each of 
which is associated with the string OPTA, OPTB, and OPTC (respectively). The 
CLIST sets X to the concatenation of these strings, delimited by blanks. So 
if the user enters "BA", X is set to "OPTB OPTA". If the user enters "CCB", 
X is set to "OPTC OPTC OPTB". Not hard.


The problem: I want each of the tokens in the generated string to be 
preceded by a double-ampersand. E.g., if the user enters ACB, I want X to be 
set to "&&OPTA &&OPTC &&OPTB".


I have read the manuals, I have tried everything I can think of... but the 
ampersands have laid me low. Any help would be greatly appreciated.


Wherever you want 1 ampersand assigned you need to use 2.

So, as you want 2 ampersands you need to use 4, and thus I suggest trying:
  IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
  ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
  ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC

Walt

--
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: CLIST question (the ampersands are killing me)

2007-05-10 Thread David Eisenberg
Follow up to my original post: the ampersands seem to have nailed me even in 
my previous message. To clarify (I hope this shows up correctly): if the user 
enters

ABC

the CLIST should produce

&&OPTA &&OPTB &&OPTC

I.e., two ampersand characters concatenated to the relevant string (e.g., 
OPTA), followed by a blank, then the same thing repeated for the next input 
character, etc.

I'm sorry for any confusion!

David

--
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: CLIST question (the ampersands are killing me)

2007-05-09 Thread Arthur T.
On Wed, 9 May 2007 21:50:48 -0400, in bit.listserv.ibm-main 
(Message-ID:<[EMAIL PROTECTED]>) "David E." 
<[EMAIL PROTECTED]> wrote:


I have inherited responsibility for a CLIST; this is not 
my forte. I'm
trying to do something pertaining to the ampersand 
character, and despite my
efforts, I cannot figure this out. As God is my witness, 
this is not a

homework assignment (I'm a BAL programmer, not a sysprog).

I've carved out and simplified the relevant portion of the 
CLIST for

perusal:

WRITENR ===>
READ L
DO &K=1 TO &LENGTH(&L)
  IF &SUBSTR(&K,&L)=A THEN SET &X=&STR(&X) OPTA
  ELSE IF &SUBSTR(&K,&L)=B THEN SET &X=&STR(&X) OPTB
  ELSE IF &SUBSTR(&K,&L)=C THEN SET &X=&STR(&X) OPTC
END
WRITE &X

The CLIST above works, and the concept is simple. The user 
is prompted to
enter a string of characters chosen from the letters A, B, 
and C, each of
which is associated with the string OPTA, OPTB, and OPTC 
(respectively). The
CLIST sets X to the concatenation of these strings, 
delimited by blanks. So
if the user enters "BA", X is set to "OPTB OPTA". If the 
user enters "CCB",

X is set to "OPTC OPTC OPTB". Not hard.

The problem: I want each of the tokens in the generated 
string to be
preceded by a double-ampersand. E.g., if the user enters 
ACB, I want X to be

set to "&&OPTA &&OPTC &&OPTB".

I have read the manuals, I have tried everything I can 
think of... but the
ampersands have laid me low. Any help would be greatly 
appreciated.


 It's been a long time, but I think the answer is to 
do something like:

set amp = &str(&)
 - or -
set amp = &str(&&)
 - or -
set amp = &str("&")
 - or -
set amp = &str("&&")

 After you figure out which of the above works, you 
can concatenate your string after &&.


 BTW, most of the people read via the Listserv, so 
only those of us who read via Usenet will see your 
post.  Otherwise I would have trimmed extensively.



--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" 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