Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Line commands through REXX

303 views
Skip to first unread message

Ramachandran, Jithesh , Cognizant

unread,
Apr 12, 2006, 4:05:04 AM4/12/06
to
Hi All,

Can we execute line commands through REXX Macro?

I am in need of running "MD" - Make dataline line command through REXX
macro...!!! Can anyone please help me if this is possible...??

Thanks in adv,

Jithesh


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Robert AH Prins

unread,
Apr 12, 2006, 5:51:43 AM4/12/06
to
"Ramachandran, Jithesh , Cognizant" <Jithesh.Ra...@COGNIZANT.COM>
wrote in message
news:5021D7164BD9DA4E9982...@ctsinchnsxub.cts.com...

> Can we execute line commands through REXX Macro?
>
> I am in need of running "MD" - Make dataline line command through REXX
> macro...!!! Can anyone please help me if this is possible...??

Most line commands have macro equivalent, but 'MD' sadly doesn't. The
closest you can get (sometimes) is using screen-scraping.

Robert
--
Robert AH Prins
prino at prino dot plus dot com


Hamilton, Robert L

unread,
Apr 12, 2006, 6:28:31 AM4/12/06
to
Can you do the command from the TSO command prompt?

bobh

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Ramachandran, Jithesh (Cognizant)
Sent: Wednesday, April 12, 2006 2:57 AM
To: TSO-...@VM.MARIST.EDU
Subject: Line commands through REXX

Hi All,

Can we execute line commands through REXX Macro?

I am in need of running "MD" - Make dataline line command through REXX
macro...!!! Can anyone please help me if this is possible...??

Thanks in adv,

Henrik Salminen

unread,
Apr 12, 2006, 6:33:01 AM4/12/06
to
Jithesh,

I don't think you can do that from a macro, but you could write your own line command(s) using Doug Nadel's excellent LMAC which you can find at http://www.sillysot.com/mvs/index.html?queryenq.htm
In this case, though, I doubt you are helped since MD can only be used as a line command and can not be generated from a macro. I know of no way to recognize non-datalines like NOTE, MSG, etc, in a macro. But you can invent your own line commands for other cases.....

Regards
Henrik Salminen

-----Ursprungligt meddelande-----
Från: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] För Ramachandran, Jithesh (Cognizant)
Skickat: den 12 april 2006 09:57
Till: TSO-...@VM.MARIST.EDU
Ämne: [TSO-REXX] Line commands through REXX

Julian Levens

unread,
Apr 12, 2006, 7:25:56 AM4/12/06
to
Jitesh

As others have already stated, the answer does seem to be NO.

Would it be an acceptable work around to do MD9999 at the top of the edit
session (or MDD top and bottom of the edit session) and then call a macro to
process the data? This aasumes that a macro could be written to identify the
lines that were non-data before the MD9999.

You could even program a PFKEY with ':MD9999;macro' then you could position
the cursor to the first line and press this function key to do everything in
one go.

If you're trying to run your edit macro in batch, then I suspect this won't
help either.

HTH

Julian


> Of Ramachandran, Jithesh (Cognizant)

Ryerse, Robin

unread,
Apr 12, 2006, 8:41:06 AM4/12/06
to
Although you can not usurp the MD routine but you can "roll your own"
line commands but choose a different line command name for it. (e.g. BD
for build data).

Here is a working Edit macro that shows how to process homemade line
commands. Note that there is a '3E'x character within the Alphadd
subroutine.

/* REXX Copy a range of lines to multiple labels.
COPY is the prefix command.
Target labels are one or two series; one series for After's and
another series for Before's. The leftmost character of each label
in the After series is "a". The leftmost character of each label
in the Before series is "b". Each label is then built by appending
a unique letter e.g. .aa, .ab, .ac, .ba .bb, .bc Note that
labels are not retricted to two charaters; e.g .bzz is acceptable.
Gaps in labels are also supported; if only .ba and .bx are
specified, they will be used but this macro will test for the
existence of the interleaving labels.

Set the labels before entering the COPY line command and beware that
ISREDIT 'eats' duplicate labels without warning.

The highest label for each series is specified as an operand to this
macro. Note that both series are not manadatory
*/

address 'ISREDIT'
'ISREDIT MACRO (AFTER,BEFORE) NOPROCESS'
address ISPEXEC 'CONTROL ERRORS RETURN'
'ISREDIT PROCESS RANGE COPY'
if rc > 4 then
do
call putzmsg 'Correct your COPY range and try again.'
exit 1
end
'ISREDIT (FIRSTIN) = LINENUM .ZFRANGE'
'ISREDIT (LASTIN) = LINENUM .ZLRANGE'

if after = '' then
do
call putzmsg 'No label designation.'
exit 1
end

t# = 0
call collect_labels after
call collect_labels before
if t# = 0 then
do
call putzmsg 'No valid destination labels for COPY.'
exit 1
end
target.0 = t#
/* call sort_label_values */ /* Wasted effort; labels are absolute */

l0 = lastin - firstin + 1
lp = firstin
do i# = 1 to l0
'(l'i#') = LINE' lp
lp = lp + 1
end


do t# = target.0 to 1 by -1
w = target.t#
if a_b.t# = 'b' then
do i# = l0 to 1 by -1
'LINE_BEFORE' w '= (L'i#')'
end
else
do i# = 1 to l0
'LINE_AFTER' w '= (L'i#')'
w = w + 1
end
end
exit

collect_labels:
if arg(1) = '' then return
parse arg ?
if left(?,1) \= '.' then ? = '.'?
parse var ? 2 a_b 3 last_target .
suffix = 'a'
do until suffix > last_target
'(LN) = LINENUM .' || a_b || suffix
if rc = 0 then
do
t# = t# + 1
target.t# = ln + 0
a_b.t# = a_b
end
if suffix == 'z' then suffix = 'aa'
else suffix = alphadd(suffix)
end
return

sort_label_values:
do t# = 1 to target.0
do tt# = t# + 1 to target.0
if target.tt# < target.t# then
do
target = target.t#
target.t# = target.tt#
target.tt# = target
a_b = a_b.t#
a_b.t# = a_b.tt#
a_b.tt# = a_b
end
end
end
return

alphadd:
/* REXX increment the specified string by one alpha character */
parse arg asis
string = translate(asis)
case = bitor(asis,copies('BF'x,length(asis)))
to = 'ABCDEFGHIJKLMNOPQRSTUVWXYZA'
from = 'Z'left(to,25)' 0123456789'
do letter_position = length(string) by -1 to 1
letter = translate(substr(string,letter_position,1),to,from)
if letter \= 'A' then leave letter_position
string = overlay(letter,string,letter_position)
end
if letter_position = 0 then string = copies('A',length(asis))
else string = overlay(letter,string,letter_position)
return bitand(string,case)



Robin Ryerse

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Ramachandran, Jithesh (Cognizant)
Sent: April 12, 2006 3:57 AM
To: TSO-...@VM.MARIST.EDU
Subject: Line commands through REXX

Ryerse, Robin

unread,
Apr 12, 2006, 8:41:19 AM4/12/06
to
I am not certain but SIGNAL ON ATTN might be your solution
0 new messages