× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, Joel:

Assuming SCNVAR returns the position of the pattern in the text in a variable named &I, you can just do something like this:

CHGVAR VAR(%SST(&TEXT &I 5)) VALUE('TEST ')

Like PL/I, CL allows the use of %SST on the left-hand side of an assignment (the CHGVAR statement). This has been in CL for many years.

The only "caveat" is that you must know the length of the part to be replaced, so you cannot replace it with longer or shorter text using this technique.

Does that help?

All the best,

Mark S. Waterbury

> On 4/15/2013 3:04 PM, Stone, Joel wrote:
For the purpose of describing the operating environment state (DEV, TEST, or PROD).

I want to call

SET_ENVR ('text or network path or email address goes here &ENVR4 and more text')

And have the CL named SET_ENVR change the text "&ENVR4" to TEST when the environment is a test environment (or PROD for production environment).

I am using the TAATOOL "SCNVAR" to locate the string of interest.

Is there a "replace" function in CL or TAATOOL or elsewhere that would help accomplish this?



End result:


SET_ENVR (jde_&ENVR_report@xxxxxxxxxxxxx) will result in the following if run from a test LPAR:

jde_TEST_report@xxxxxxxxxxxxx


If run on a production LPAR, the environment would resolve to:

jde_PROD_report@xxxxxxxxxxxxx


Thanks!



______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.