REXX tool to change a particular word in more than 50 PS at a time- PLS help

65 pts.
Tags:
REXX
REXX Mainframe
REXX Procedure
Hi everybody,

I need a rexx tool to change a word called HRTKD.VSAM to HRTKO.VSAM in more than 50 PS(sequential dataset) at the same time. -- Is it possible... Please help.. Thanks



Software/Hardware used:
Mainframes
ASKED: January 13, 2010  12:57 PM
UPDATED: February 2, 2010  6:41 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Sure. This can be done. REXX (or a CLIST) can do this with the old TSO editor, or REXX (maybe with an EDTMACRO) can do it within ISPF. So that is your first decision.

In either approach, you will have to get the dataset names passed to the routine.

One way would be to list the names of the 50 DSNs in a a dataset,
have your REXX read the first DSN from the list,
edit that dataset,
change all xxxxx to yyyyyyy
save the dataset
loop around to read the next DSN from the list.

Maybe a batch job that executes a PROC for each of the 50 DSNs where the PROC does the change.

I know I have something like this, but I did a quick search and cannot find it.

If I locate it, I will post it here.

Steve

Hi Steve…

Thanks a lot… I will add on some points here.

i have a rexx code with me to change xxxx to yyyy in more than 50 PS at a time. But my question now is , i want to change xxxx.zzzz to yyyy.zzzz in more than 50 PS at a time.
The code which i have changes xxxx.zzzz to yyyy. Tat s it…. I need to get it as yyyy.zzzz.

Hope you get what am trying to say.

Thanks

Archana

Hi Archana,

you have code to change xxxx.zzzz to yyyyy
but you want to change xxxx.zzzz to yyyyy.zzzzz

Well, it shouldn’t be too tough to change your code. Simply modify your code, where it currently has yyyyy just make it yyyy.zzzzz
OR
remove the zzzzz from the equation and chage all xxxx to yyyy but if there are occurences of xxxxx without the zzzzz portion they too will be affected.

It is quite possible that I do not understand your question.

Hi Steve,

i just have a code to change xxxx to yyyy. But my requirement is i hav to change xxxx.zzzz to yyyy.zzzz in more than one PS at a time.

For example i need to change HRTKD.VSMBR_STAFF_MBR to HRTKO.VSMBR_STAFF_MBR .

I jus wan the first qualifier to be changed and the second should remain as it is.

The code which i have changes HRTKD.VSMBR_STAFF_MBR to HRTKO. The second qualifier disappears.This is wrong right.? And one more thing is the second qualifier is different in all the PS. It is not the same.

If it is the same one then i can do as u said… Tat is changing all yyyy to yyyy.zzzz. But in my case its not possible.

Hope you understand my question now.

Thanks

Archana

—–

My Dear Archana,

you have code that changes xxxx to yyyy
but it seems to truncate data following the change
value before change: xxxx.zzzz
value after change : xxxx
it truncates the period and everthing after it.
right?

what about anything following zzzz?
value before change: xxxx.zzzz abcdef what happens to “abcdef”?

what happens if the value before the change ends with something other than a period?
value before change: xxxxzzzzaaaa what happens to zzzzaaaa
or
value before change: xxxx abcdef ghi what happens here

The period can be important when one is using variables in REXX & CLIST. Some older syntax always ending the variable with a period. If one needs a period then frequently one would type 2 periods so that one could be stripped off and one would remain. (somewhat akin to writing SQL and you want to end up with quotation marks in your output, you must code extra quote marks (one delineates the literal and one is part of the literal). Same thing here with periods.

But I am not sure that that previous discussion on periods addresses the removal of data following the xxxx. That puzzles me.

You might look very closely at the code and run some tests to see what might be wrong. Use the few examples above to see what happens. And come up with some of your own as well.

If it were me I would limit myself to testing the ‘change xxxx to yyyy’ portion and test it many, many different ways to find out exactly what it is doing.

Sorry, that is all I can think of at this time. I close with a few examples of using periods, just in case they might be helpful.

example of using period to end a variable; in this case a variable named ROW
(I think this is a CLIST)
“LINE &EVAL(&ROW.) = LINE”, < 60 (MSG1)>

example of CLIST using the old TSO editor to make changes to JCL (definately a CLIST):
<pre>
SET &FROMA = &STR(DYYJJJ.THHMMSST.A0000000)
SET &FROMB = &STR(DYYJJJ.THHMMSST.B0000000)
SET &TOA = &STR(&SUBSTR(1:16,&AD345)&STR(A)&SUBSTR(18:24,&AD345))
SET &TOB = &STR(&SUBSTR(1:16,&AD345)&STR(B)&SUBSTR(18:24,&AD345))

EDIT ‘DB2N.DISASTER.CNTL(STEP080)’ OLD DATA NONUM
CONTROL MSG
CHANGE * 99999 /&STR(&FROMB)/&STR(&TOB)/ALL
END SAVE
</pre>

example of using a period as part of an ISPF editor line name (used in REXX EDTMACRO)
Queue ” &ZCURSOR = .CURSOR”

Hi Steve

Thanks a lot for your valuable information.

I will test my code with all possible changes and get back to you soon.

Thank you

Archana

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Archvimk
    Hi Steve... Thanks a lot... I will add on some points here. i have a rexx code with me to change xxxx to yyyy in more than 50 PS at a time. But my question now is , i want to change xxxx.zzzz to yyyy.zzzz in more than 50 PS at a time. The code which i have changes xxxx.zzzz to yyyy. Tat s it.... I need to get it as yyyy.zzzz. Hope you get what am trying to say. Thanks Archana
    65 pointsBadges:
    report
  • samkumar

    I need to find & copy the record from particular dataset (DATAIN) using input dataset(DATA)

    For ex:

    Input dataset (DATA) having following details

    1234

    4567

    7890

    Have to find above records in particular dataset (DATAIN) using as DATA and copy to output dataset .

     

    10 pointsBadges:
    report
  • TomLiotta
    I need to find & copy the record from particular dataset (DATAIN) using input dataset(DATA)   Then you probably should open a question about it. You shouldn't try to take over a thread that covers a different problem.   When you ask your question, be sure you also tell us what problem you're having and show the code that has the problem.   Tom
    125,585 pointsBadges:
    report
  • samkumar
     I need to find & copy the record from particular dataset (DATAIN) using input dataset (DATA - as 'JONES' and 'SAM') and write these recods in the OUTPUT dataset.. but here is the code to find the particular record as 'JONES' hard coded in program. But i need to find the various inputs like 'JONES' and 'SAM'...etc done = 'no'lineno = 0DO WHILE done = 'no'  "EXECIO 1 DISKR indd"   IF RC = 0 THEN                              /*  Record was read */     DO       PULL record       lineno = lineno + 1                    /*  Count the record */       IF INDEX(record,'JONES') \= 0 THEN         DO           SAY 'Found in record' lineno           done = 'yes'           SAY 'Record = ' record         END       ELSE NOP     END   ELSE     done = 'yes'ENDEXIT 0 Can u please help how to find the different values in one dataset and write full record into output dataset?
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following