IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX Shortcuts


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jpleocadio1970

New User


Joined: 15 Nov 2014
Posts: 1
Location: Portugal

PostPosted: Tue Nov 18, 2014 4:39 pm
Reply with quote

Hi everbody,

The previous bank that I worked for had 2 REXX shortcuts very handy:

1. shortcut: SSD
In the command line we type SSD and we go directly to job output instead of doing S;ST

2. COB
In our COBOL Source, we could compile directly by member with shortcut COB, that would call 2 jobs: compile & bind (the program name would be retrieved and the compilation job would be submitted).

Any expert on REXX that could help me ?

Many thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 18, 2014 5:38 pm
Reply with quote

They sound like "In house" routines, so unless you cribbed a copy .......
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Nov 19, 2014 10:09 pm
Reply with quote

re: COB

You need an editor macro that:

1. issues SAVE (so the compile job gets your latest changes)
2. uses DATASET and MEMBER statements to determine what you are editing.
3. Build job to compile the member being edited.
4. submit the job.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Feb 15, 2016 4:00 pm
Reply with quote

Just saw this... a little late in response, perhaps it's still useful?

SSD:
Code:
/*REXX*/                                                           
ADDRESS ISPEXEC "SELECT PGM(ISFISP) NEWAPPL(ISF) NOCHECK PARM(ST)",
                       "SCRNAME(SSD) "

COB:
Needs a Compile&Link skeleton: COBCL
(you will probably need to tailor this ?)
Code:
//IGYCRCTL PROC MEMBER=,
//            SOURCE=,
//            LOAD=,
//            OPTS='QUOTE,NONUMBER,NOLIST,NOMAP',
//            WSPACE='CYL,(1,1)'
//COMPILE  EXEC PGM=IGYCRCTL,PARM=(&OPTS)
//STEPLIB  DD DSN=SYS1.COB2LIB,DISP=SHR
//SYSUT1   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT2   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT3   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT4   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT5   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT6   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSUT7   DD UNIT=VIO,SPACE=(&WSPACE)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DSN=&SOURCE(&MEMBER),DISP=SHR
//SYSLIN   DD DSN=&&OBJECT,DISP=(,PASS),
//            LRECL=80,BLKSIZE=3120,RECFM=FB,
//            SPACE=(&WSPACE)
//LKED     EXEC PGM=IEWL,REGION=1024K,
//            PARM='XREF,LIST,LET',COND=(4,LT,COMPILE)
//SYSPRINT DD SYSOUT=*
//SYSLIB   DD DISP=SHR,DSN=SYS1.COB2LIB
//         DD DISP=SHR,DSN=SYS1.SCEELKED
//         DD DISP=SHR,DSN=SYS1.SCEESAMP
//SYSLIN   DD DSN=&&OBJECT,DISP=(OLD,DELETE)
//SYSLMOD  DD DISP=SHR,DSN=&LOAD(&MEMBER)
//SYSUT1   DD UNIT=VIO,BLKSIZE=1024,SPACE=(CYL,(1,1))
//SYSTERM  DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//IGYCRCTL PEND
//*


And another little skeleton: COB:
Code:
//COMPILE  EXEC IGYCRCTL,     
//         MEMBER='&MBR',     
//         SOURCE='&LIB',     
//         LOAD='&LOAD'       


Then a Macro: COB
Code:
/*REXX*/ TRACE "O"                         
ADDRESS ISPEXEC "CONTROL ERRORS RETURN "   
ADDRESS ISREDIT                             
"MACRO NOPROCESS "                         
"(LIB) = DATASET "                         
"(MBR) = MEMBER "                           
load = LEFT(lib,LASTPOS(".",lib))"LOAD"     
ADDRESS ISPEXEC "FTOPEN TEMP "             
ADDRESS ISPEXEC "FTINCL ISRJSJC "           
ADDRESS ISPEXEC "FTINCL COBCL NOFT "       
ADDRESS ISPEXEC "FTINCL COB "               
ADDRESS ISPEXEC "FTCLOSE "                 
ADDRESS ISPEXEC "VGET (ZTEMPF) SHARED "     
ADDRESS TSO "SUBMIT '"ztempf"'"             
EXIT     


As you can see this reys on a standard name for the LOADLIB which is related to the source library.
I tried this on a little DUMMY program as the last 'real' COBOL program I wrote was punched on an IBM Model 27!

/Steve
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Feb 15, 2016 4:05 pm
Reply with quote

Oh yes, another assumption is you have a jobcard set up in ISPF Option 5.
It uses the standard skeleton ISRJSJC to pull this in.
/S icon_cool.gif
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Feb 15, 2016 5:56 pm
Reply with quote

Re the SDSF thingie, for that you will need an ISPF command table entry. The ISPCMDU program in Use [URL] BBCode for External Links file 349 lets you do that dynamically.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Feb 15, 2016 6:21 pm
Reply with quote

see here for CTBADD and CTBSTO snippets
ibmmainframes.com/viewtopic.php?t=56254&highlight=ctbadd
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Tue Feb 16, 2016 3:59 pm
Reply with quote

One can do it the "clumsy" way too.
► 3.3 copy 'ISPPROF' (mine's called ISPF.ISPPROF here) member ISRCMDS to XXXCMDS
► 3.9 Add your SSD command: as SELECT CMD(SSD)
(I close all other screens at this point, just in case I screw something up somehow)
► 3.3 copy 'ISPPROF' member XXXCMDS to ISRCMDS (or use TSO COPY or SMCOPY in native if you are extra paranoid)
► Restart ISPF (not sure this is essential but I do it)
/Steve
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Feb 16, 2016 5:06 pm
Reply with quote

Or you can do it with a little exec:

Code:
/* REXX exec to update my command tables                              */
/*** trace ?r ***************************************************** \| *
*               (C) Copyright Robert AH Prins, 2009-2016               *
************************************************************************
*  ------------------------------------------------------------------  *
* | Date       | By   | Remarks                                      | *
* |------------+------+----------------------------------------------| *
* |            |      |                                              | *
* |------------+------+----------------------------------------------| *
* | 2010-05-13 | RAHP | Use ISPTABL, not ISPPROF                     | *
* |------------+------+----------------------------------------------| *
* | 2009-04-16 | RAHP | Now RAHP- and HERECMDS                       | *
* |------------+------+----------------------------------------------| *
* | 2009-04-08 | RAHP | Initial version                              | *
* |------------+------+----------------------------------------------| *
************************************************************************
* UCMDS is a REXX exec to update my site-independent (RAHPCMDS) and    *
* site-specific (HERECMDS) tables. Because it is not possible to       *
* update an open ISPF command table, this exec copies it to $$$$CMDS,  *
* invokes ISPUCM (the command table update program) with a parameter   *
* of $$$$ and then copies the updated table back to USERCMDS. Note     *
* that is necessary to restart ISPF to enable any new commands.        *
*                                                                      *
* Copies of the new command tables are saved to my exec library.       *
************************************************************************
* Send questions, suggestions and/or bug reports to:                   *
*                                                                      *
* robert@prino.org / robert.ah.prins@gmail.com                         *
*                                                                      *
* Robert AH Prins                                                      *
* Taboralaan 46                                                        *
* 8400 Oostende                                                        *
* Belgium                                                              *
************************************************************************
* This program is free software: you can redistribute it and/or        *
* modify it under the terms of the GNU General Public License as       *
* published by the Free Software Foundation, either version 3 of       *
* the License, or (at your option) any later version.                  *
*                                                                      *
* This program is distributed in the hope that it will be useful,      *
* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         *
* GNU General Public License for more details.                         *
*                                                                      *
* You should have received a copy of the GNU General Public License    *
* along with this program. If not, see <http://www.gnu.org/licenses/>  *
***********************************************************************/
parse source source
parse value source with . . moi .

user.1 = 'RAHP'
user.2 = 'HERE'
user.0 = 2

"ispexec vget (ucmds) shared"

if rc = 0 then
  do
    "ispexec verase (ucmds) shared"

    temp = copies('$', length(ucmds))

    "isredit macro"
    "isredit (MEM) = member"

    now = date('S')
    now = substr(now, 1, 4) || '/' ||,
          substr(now, 5, 2) || '/' ||,
          substr(now, 7, 2)

    select
      when mem = temp'CMDS' then
        "isredit c '"temp"CMDS' '"ucmds"CMDS' first"

      otherwise
    end

    "isredit end"

    exit
  end

!tabl = getvar('ispTABL')

drop isptabl
drop exec

"ispexec lminit dataid("isptabl") ddname(isptabl) enq(shrw)"
"ispexec lminit dataid("exec")",
               "dataset('"getvar('execRAHP')"') enq(shrw)"

do u = 1 to user.0
  temp  = copies('$', length(user.u))
  ucmds = user.u

  "alloc f(i) da('"!tabl"("user.u"cmds)') shr reu"
  "alloc f(o) da('"!tabl"("temp"cmds)') shr reu"

  "execio * diskr i (finis"
  "execio" queued() "diskw o (finis"

  "ispexec select pgm(ispucm) parm("temp")"

  "ispexec vput (ucmds) shared"
  "ispexec edit   dataid("isptabl") member("temp"cmds) macro("moi")"

  "execio * diskr o (finis"
  "execio" queued() "diskw i (finis"

  "free f(i)"
  "free f(o)"

  "ispexec lmcopy fromid("isptabl")   todataid("exec")",
                 "frommem("temp"cmds) tomem("user.u"cmds) replace"
end

"ispexec lmfree dataid("exec")"
"ispexec lmfree dataid("isptabl")"
exit


Note: "getvar" is my routine to retrieve all kinds of data from one location, making it easy to port my exec library from one location to another, I only have to change one single member! For those interested, it's on "that" system ask me and I'll give you RACF READ access.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top