On 18 May 2012 11:36, Scott Ford <scott_j_f...@yahoo.com> wrote:
> All:
>
> I am in the process of writing a Rexx program that will call an Assembler 
> program and pass parameters.
> The program is simple..
>
> -----------------------------------------------------------------------------------------
> Rexx:
> /* TSTGFILE  */
> trace i
> say 'Address is: 'address()
> address TSO "CALL 'SFORD.LINKLIB(TESTCALL)' 'CLASS(USER' "
>
> ----------------------------------------------------------------------------------------

What you've got is a TSO call command. It has really nothing to do with REXX.

> Assembler:
>
> TESTCALL CSECT
> TESTCALL AMODE 31
> TESTCALL RMODE ANY
>          YREGS
>          SPACE 3
>          SAVE (14,12),,'TESTCALL..&SYSDATE..&SYSTIME'
>          LR    R12,R15
>          USING TESTCALL,R12
>          L     R4,0(R1)
>          ST    R4,8(R13)
>          ST    R13,4(R4)
>          LR    R13,R4
>          L     R1,4(R1)
>          MVC   CLASSN(8),0(R4)
>          MVC   SUBMSGA+20(8),CLASSN
> SUBMSGA  WTO   'PARM1:                        ',ROUTCDE=11
> BAILOUT  DS    0H
> L     R13,SAVEAREA+4
>          RETURN (14,12),RC=0
> CLASSN   DS    CL8
> PROFN    DS    CL8
> SAVEAREA DS    18F
> ----------------------------------------------------------------------------------------------------------------------------------------
> Execution JCL:
>
> //REXXGRP JOB ,SYSTEMS,CLASS=A,MSGCLASS=X,
> //      MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID
> //STEP1    EXEC PGM=IKJEFT01,DYNAMNBR=99
> //STEPLIB  DD DSN=SFORD.LINKLIB,DISP=SHR
> //SYSEXEC  DD DSN=SFORD.CLIST.LIBRARY,DISP=SHR
> //SYSOUT   DD SYSOUT=*
> //SYSPRINT DD SYSOUT=*
> //SYSTSPRT DD SYSOUT=*
> //SYSTSIN  DD *
>   %TSTGFILE
> /*
> -----------------------------------------------------------------------------------------------------------------------------------------
> Output:
>
>                        J E S 2  J O B  L O G  --  S Y S T E M  A D C D  --  N 
> O
>
> 09.17.26 JOB00225 ---- FRIDAY,    18 MAY 2012 ----
> 09.17.26 JOB00225  IRR010I  USERID SFORD    IS ASSIGNED TO THIS JOB.
> 09.17.26 JOB00225  ICH70001I SFORD    LAST ACCESS AT 09:17:12 ON FRIDAY, MAY 
> 18,
> 09.17.26 JOB00225  $HASP373 REXXGRP  STARTED - INIT 1    - CLASS A - SYS ADCD
> 09.17.26 JOB00225  IEF403I REXXGRP - STARTED - TIME=09.17.26
> 09.17.27 JOB00225  +PARM1:        CL
> 09.17.27 JOB00225  IEF404I REXXGRP - ENDED - TIME=09.17.27
> 09.17.27 JOB00225  $HASP395 REXXGRP  ENDED
>
> I assumed I misunderstand how parameters are passed in Rexx to Assembler...I 
> thought that
> R1 pointed to the Adcon list...can someone be so kind as to point this old 
> fellow .the right way

It does. R1 points to a list of fullword addresses, and in this case
there will be only one. You load that first and only pointer into R4
with
>          L     R4,0(R1)
Now R4 points to a halfword length field(10), followed by the argument
text - in your case "CLASS(USER". So far, so good. (At this point, I
would just do a WTO with the TEXT= option. TEXT= takes a pointer to a
halfword length followed by text, so you are all set.)

Then there is some code that appears to confuse chaining save areas
with the argument you've been passed...
>          ST    R4,8(R13)
>          ST    R13,4(R4)
>          LR    R13,R4
>          L     R1,4(R1)

If you want to include some hardcoded text such as "PARM1: ", then you
might do better to reserve an area, e.g.
MSG   DS    Y(*-*),CL256
move in your local constant text and the argument you received, make
sure the length field covers both, and then issue the WTO TEXT=.

You could even easily achieve reenterability this way, should that
matter to you.

Tony H.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

Reply via email to