Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
Posted: Mon Feb 09, 2004 4:48 pm Post subject:
I would use CHANGE ALL P'.' X'50'
I have seen an answer somewhere that manages to preserve the ampersand, but I'm too tired to search for it! _________________ The day you stop learning the dinosaur becomes extinct
Wouldn't that command be issued as part of an ISPF EDIT Macro, not necessarily from a REXX EXEC? I don't recall a 'CHANGE' command within the REXX language.
There is an earlier thread I posted about formatting output in REXX. The raw output was sometjing like:
Code:
AMP AAI MAA - ..SAB2
AMP AAI EAA - ..SAB4
AMP CRDP AJT - ..SAF2
AMP CRDP SUP - ..SAF6
were the .. are non-display charaters. I had asked for some code to find these characters and replace them with blanks... The non-dispaly characters can be any ware in the string.
I have tried everything suggested but it only partially works. In other words some of the non-display characters are replaced by blanks but not all.
I then thoought that it would be better to switch the non-display characters to something else first and then replace the substitutes by blanks.
In case it matters the raw output is generated by calls to REXX subroutines from a QAHIPERSTATION script.
so here is all the code I am using ( Note that I am not the original authour of these subroutines and only partially understand what is going on )
SUB1 - Create/open the output files ( Called once per script )
SUB4 - Accepts four inputs and builds 1 line in the raw ouput file.
The inputs are:
Code:
INP1 - A fast path to the screen
INP2 - The last menu item before a screen is reached.
INPUT2 - The screenname (From SUB2 )
INPUT3 - The screen description ( From SUB3 )
here is the actual code to SUB4
Code:
/*rexx*/
ARG in, in1, in2, in3
fastpth = in in1 in2
PARSE VAR fastpth a1 a2 a3 a4 a5
a1=left(strip(a1,'L','30'X),7)
a2=left(strip(a2,'L','30'X),7)
a3=left(strip(a3,'L','30'X),7)
a4=left(strip(a4,'L','30'X),7)
a5=left(strip(a5,'L','30'X),7)
a6='-'
a7=left(a6,7)
IF a3 = '' & a4 = '' & a5 = '' THEN
DO
a5=a2
a2=a7
a3=a7
a4=a7
END
ELSE
IF a4 = '' & a5 = '' THEN
DO
a5=a3
a3=a7
a4=a7
END
ELSE
IF a5 = '' THEN
DO
a5=a4
a4=a7
END
dat.1=a1 a2 a3 a4 a5 in3
ADDRESS TSO "EXECIO 1 DISKW MYFILE (STEM dat."
RETURN
After SUB4 I am getting the re-formatted output ....
Code:
COM ICA ECH - RGJ4
COM ICA ECL - RGG4
COM ICA EDTP - AC04
COM ICA EI1 - RGC0
COM ICA EI2 - RGC2
COM ICA RDLD - ..AC60
COM ICA RDLR - AC64
COM ICA RDUF - ..ACG4
COM ICA RNO - RGN0
COM ICA RRMC - AC00
COM ICA RVGS - AC02
As you can see the non-display characters are still there.
Were in SUB4 should I use the MACRO change all P'.' '&'
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
Posted: Tue Feb 10, 2004 5:44 pm Post subject:
Maton_Man, you're probably right, in Rexx. It would certainly be another story with CLIST.
John, you simply can't use an edit command in a Rexx procedure like that.
I think your best plan is probably to establish what the characters actually are, then extend the TRANSLATEs to convert them.
Sorry I can't be more help. _________________ The day you stop learning the dinosaur becomes extinct
Mervyn...who in their right mind would still code CLIST?
You could post process your output with a macro or you could do as suggested and translate any non-alpha, non-numeric character to a blank using translates. _________________ My opinions are exactly that.
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
Posted: Thu Feb 12, 2004 4:16 pm Post subject:
Maton_Man, you'd be surprised how many people out there are still using CLIST.
I've been known to use it myself, usually with short edit macros. It can actually save keystrokes. _________________ The day you stop learning the dinosaur becomes extinct
Give me a break Merv! Save keystrokes? How many times do you really worry about that!?!?
I am not suprised (as such) at the number of people who use it. Perhaps mystified would be a better word.
CLIST is redundant. There is no NEED for it. It is harder to read and generally only used by people who haven't learnt or refuse to learn Rexx.
Rexx is infinitely more powerful and portable and of the two is the only one which is being developed. Why encourage (not saying you are) people to use a dying language? _________________ My opinions are exactly that.
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
Posted: Fri Feb 13, 2004 3:31 pm Post subject:
Maton_man,
I used CLIST for this:
Code:
ISREDIT MACRO
ISREDIT X ALL
ISREDIT C ALL 'TRK,(60,30)' 'CYL,(5,5)'
I wouldn't have used CLIST for this:
Code:
/* rexx macro to total a column */
address isredit
"MACRO (START END) NOPROCESS"
"PROCESS RANGE C"
"(CMD) = RANGE_CMD"
"(A) = LINENUM .ZFRANGE"
"(B) = LINENUM .ZLRANGE"
numeric digits 12
accum = 0
"(LAST) = LINENUM .ZLAST"
do i = a to b
"(LINE) = LINE" i
x = substr(line,start,(end-start)+1)
if datatype(x) = 'NUM' then
accum = accum + x
end
zedsmsg = accum
zedlmsg = 'Total in columns' start 'to' end 'is' accum
address ispexec "SETMSG MSG(ISRZ001)"
I really don't have a problem with my choices here.
Judging from your photograph, I think you should get out more. _________________ The day you stop learning the dinosaur becomes extinct
If its keystrokes you are wanting to save then Rexx would have served you better...* You would have saved a whole 3 keystrokes!!!
ADDRESS ISREDIT
"MACRO"
"X ALL"
"C ALL 'TRK,(60,30)' 'CYL,(5,5)'"
15 + 7 + 7 + 33 = 62 characters
ISREDIT MACRO
ISREDIT X ALL
ISREDIT C ALL 'TRK,(60,30)' 'CYL,(5,5)'
13 + 13 + 39 = 65 characters
I don't have much to do at the moment, and as for getting out more - I have a few more years left in the tank to do it than you it would seem (from your photo).
* - with the caveat that you allocate your Rexx library to SYSEXEC as is proper and that you omit the /*Rexx*/ which is then not necessary. _________________ My opinions are exactly that.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum