Pass a string from edit macro to command line
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: Pass a string from edit macro to command line Author: misi01Location: Stockholm, Sweden PostPosted: Mon Nov 08, 2021 11:05 am
    —
Maybe I'm having a senior moment here, but I'm damned if I can think of how to do this.
What I would like to do would be to have a simple edit macro that analyzes the current code and generates a string such as
Quote:

compare 'my.hlq.cobol(member)'

and places this on the command line without actually running the compare command (so the user could change the MY string to something else if they wanted to).
I tried the obvious of "exit 'my_string'" but edit doesn't like that.
I'm guessing there's a trivial way of doing this, but how ?

Alternatively ..... is there a way of defining a PFKEY such that it only returns the defined string rather than executing the actual command (ideally if it was doable, one could position the cursor to be placed in a particular column of the command line; in the example above, under the first m in member)

#2:  Author: kolusuLocation: San Jose PostPosted: Mon Nov 08, 2021 4:11 pm
    —
misi01,

If your intention is to generate a tso command then you can PUSH function to store the command into the TSO command stack. You can then PULL the command whenever you want it.

#3:  Author: misi01Location: Stockholm, Sweden PostPosted: Tue Nov 09, 2021 1:57 am
    —
How do you see that working ?
I'm editing a file in ISPF. From the command line, I run an edit macro that does (say)
Quote:

push "compare 'xxx.yyyy.IKK.COBOL("ecele"x)'"
exit 1

but when I return to the edit screen, the stack still contains the compare command - that isn't read in by ISPF. Or am I misunderstanding your intention ?

#4:  Author: misi01Location: Stockholm, Sweden PostPosted: Tue Nov 09, 2021 2:54 am
    —
This is a follow-on explaining a bit more what I would like to do and what is happening as-is.
If I edit source code in "our" Endevor, I can enter the command
Quote:

compare 'prod.code(same_member_as_being_edited)'

and compare will produce a "report" where differing lines are shown in blue/green with a label as shown below (.OAAAA is a line that differs from the prod code)
Quote:

000015 * IAT473 211022 small bug when closing the current cursor
.OAAAA * IAT473 211109 IIV817 cursor needs to be closed deliberately

If I instead run a an edit macro that runs the following command
Quote:

"compare 'IAT473.QERCVY06.RECOVERY' 'xxx.yyy.IKK.COBOL(IIV033)'"

I get a simple SYSOUT type of result (as if I'd run SUPERC from 3.13) along these lines
Quote:

PAGE 0001 8:27:20 2021.313
VOL=SER=PRIA15 MEMBER= OLD DSN=IAT473.QERCVY06.RECOVERY
VOL=SER=MVS035 MEMBER=IIV033 NEW DSN=xxx.yyy.IKK.COBOL


-1- OLD--- * IAT473 211109 IIV817 cursor needs to be closed deliberat
---------------------------------------------------------------------


-1- OLD--- MOVE K-STANG-CURSOR TO IV81715-KD-DB-HANT
2- OLD--- CALL SUB-IIV817 USING IV81715-IV81715
3- OLD--- *
---------------------------------------------------------------------


2 BLOCKS OF COMPARE ERRORS DETECTED

I've run the command tso isrddn to see whether there's a "driver routine" for COMPARE, but "m compare" in ISRDDN says member not found.
I've tried googling to see whether there's a parameter I'm missing for COMPARE to produce such a result (the first), but I can't find anything.
I'm guessing it's all to do with the fact that I'm doing the compare via a macro rather than the command line (thereof my desire to "paste" the actual compare command onto the command line).

#5:  Author: Terry_HeinzeLocation: Richfield, MN, USA PostPosted: Tue Nov 09, 2021 9:18 am
    —
Could you simply copy "compare 'my.hlq.cobol(member)' " to the clipboard, then paste the clipboard contents into your command line of the member you're editing?

#6:  Author: misi01Location: Stockholm, Sweden PostPosted: Tue Nov 09, 2021 10:33 am
    —
Indeed I could, but wouldn't it be neat if you could set a PF key that automatically picked up the name of the current member and did a compare on that vis-à-vis the corresponding production member.
Press PF key vs find the relevant notepad text, copy it, paste it, change the member name, press enter.
If it's doable, I know which I'd prefer.

#7:  Author: misi01Location: Stockholm, Sweden PostPosted: Tue Nov 09, 2021 11:54 pm
    —
It occurred to me just now. logically, what is the difference between what I'm trying to do and the default setting of PF12, the retrieve key.
Both fetch a string from somewhere and then place it on the command line, without actually executing the command?
The only question is, how does the retrieve key do that?



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group