MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSO Command under REXX
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon Feb 09, 2004 2:07 pm    Post subject: TSO Command under REXX Reply with quote

How can I ( if it is possible ) issue this command from REXX

CHANGE all P'.' '&'
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon Feb 09, 2004 4:48 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Feb 09, 2004 9:04 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Feb 09, 2004 9:21 pm    Post subject: Reply with quote

Bang on the money Superk.

/* rexx */
address isredit
"MACRO"
"CHANGE all P'.' '&'"

I am most intrigued as to why you would want to change all non-display characters to ampersands...

CHANGE all P'.' '&' works for me so I'm not sure what you're getting at Merv.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Tue Feb 10, 2004 9:56 am    Post subject: Reply with quote

The reason for this requerst is kinda bizzar.

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 )
Code:

/*rexx*/                                                             
ADDRESS HSCMDS "ALLOC DA('jec120.OUTPUT.DATA') F(MYFILE) SHR REUS"   
ADDRESS HSCMDS "ALLOC DA('jec120.HIPER.SYSTSIN') F(SYSTSIN) SHR REUS"
ADDRESS TSO "EXECIO 0 DISKW MYFILE (OPEN"                           

SUB2 - Returns the screename from a given screen ( Called everytime a
new screen is accessed).
Code:

row=1                                                   
col=1                                                   
len=8                                                   
var1=SUBSTR(SCREEN,(row-1)*80+col,len)                 
SCREEN20 = TRANSLATE(var1,'00'X,'20'X)                 
SCREEN28 = TRANSLATE(SCREEN20,'00'X,'28'X)             
scrname1 = TRANSLATE(STRIP(SCREEN28,B,'00'X),' ','00'X)
RETURN scrname1                                         


SUB3 - Returns the descriptive name of the screen found by SUB2.
Code:

row=1                                                       
col=10                                                     
len=69                                                     
var1=SUBSTR(SCREEN,(row-1)*80+col,len)                     
SCREEN20 = TRANSLATE(var1,'00'X,'20'X)                     
SCREEN28 = TRANSLATE(SCREEN20,'00'X,'28'X)                 
scrname1 = TRANSLATE(STRIP(SCREEN28,B,'00'X),' ','00'X)     
RETURN scrname1                                             


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'.' '&'
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Feb 10, 2004 5:44 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Tue Feb 10, 2004 6:35 pm    Post subject: Reply with quote

ok....

1 - Could i run the macro form a jcl call....
2 - I have heard of CLIST but have no idea how this would be done ?
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Feb 12, 2004 12:28 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Feb 12, 2004 4:16 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Feb 12, 2004 4:25 pm    Post subject: Reply with quote

John, it is possible to run EDIT in batch. You need a jobstep like this:

Code:

//STEP1    EXEC PGM=IKJEFT01                                 
//SYSPROC  DD DISP=SHR,DSN=YOUR.REXX.PDS
//SYSEXEC  DD DISP=SHR,DSN=YOUR.REXX.PDS
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                       
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                       
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU                       
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                       
//ISPPROF  DD UNIT=VIO,SPACE=(TRK,(1,1,1)),LRECL=80,BLKSIZE=80
//ISPLOG   DD SYSOUT=*,LRECL=80,BLKSIZE=80                   
//SYSTSPRT DD SYSOUT=*                                       
//SYSTSIN  DD *                                               
 ISPSTART CMD(TEST1)                                         
/*


(with thanks to Coolman)

Your ISPF libraries may not be named as above. You can find out with ISRDDN.

Your Rexx command 'TEST1' (or what you will) would need to go something like this:

Code:

/* rexx procedure to run an edit macro in batch */

address ispexec "EDIT DATASET('XXXX.YYYY.ZZZZ') MACRO(NODUDS)"


and your EDIT macro (NODUDS in the above example) would look something like this:

Code:

/* rexx edit macro to convert dud characters to ampersands */
      
address isredit
"MACRO"
"C ALL P'.' '&'
"END"

_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Feb 12, 2004 9:47 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Feb 13, 2004 3:31 pm    Post subject: Reply with quote

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. Very Happy
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Sun Feb 15, 2004 5:13 pm    Post subject: Reply with quote

If its keystrokes you are wanting to save then Rexx would have served you better...* Very Happy 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). Wink


* - 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.
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon Feb 16, 2004 7:41 am    Post subject: Reply with quote

It's not the years in the tank that count, it's the fire in the belly

Twisted Evil
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Feb 16, 2004 6:47 pm    Post subject: Reply with quote

What? No touche? No bowing before my great keystroke saving Rexx prowess?

If I ever make it back to England I'll look you up and we can compare fire bellies over a pint.

Cheers. 8)
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group