Page 2 of 3

Re: Call Assembler from REXX with parameters

PostPosted: Thu Jan 13, 2011 12:19 am
by alexm
You may have a look at this documentation: http://publib.boulder.ibm.com/infocente ... htm#lnkatt
In our shop we're calling all types of programs using linkpgm. By using this, you can pass parameters to the called program, that program can change the parameters and pass it back to the REXX. Basically the approach that was mentioned above (DSNTIAR sample code)

Re: Call Assembler from REXX with parameters

PostPosted: Thu Jan 13, 2011 12:34 am
by dick scherrer
Hello,

What happens if you call this assembler program from a cobol "driver"?


I haven't tried yet, but what do you mean?
This was just a suggestion to confirm that the assembler program would run successfully when invoked from another caller. . .

As you posted - when tried, it worked ok :)

Re: Call Assembler from REXX with parameters

PostPosted: Thu Jan 13, 2011 2:29 am
by Pedro
I think you need to use your interactive debugger to stop the assembler program at the beginning. Do this twice
1. from cobol: display register 1 and the address list and parameters it points to.
2. from rexx: display register 1 and compare with parameter list structure from cobol

Re: Call Assembler from REXX with parameters

PostPosted: Thu Jan 13, 2011 11:11 am
by steve-myers
Did you read the fine manual? Rexx sends the arguments to an external function in a slightly weird way.

Rather than using arguments you might look into using IRXEXCOM or IKJCT441 to extract or alter variables more directly. These routines are discussed in the same general area as the link in the first paragraph.

Re: Call Assembler from REXX with parameters

PostPosted: Sun Jan 23, 2011 12:53 pm
by Greenhouse
I didn't managed calling assambler from rexx.

It's always fails with abend 0C4 no matter how I prepare parameters.
pgm_rc      = copies('00'x,2) 
conv_type   = 'F1'x           
reserved    = copies('00'x,1) 
data_char#  = '00F1'x         
data_before = copies('00'x,510)
data_after  = copies('00'x,510)
data_unconv = copies('00'x,2) 


do i = 1 to hex_array.0
   hex_val = hex_array.i                                                 
   cmd = "x_val = '"hex_val"'x"                       
   interpret cmd                                       
             
   parm1 = pgm_rc||conv_type||reserved||data_char#     
   parm2 = overlay(x_val,data_before,1)               
   parm3 = data_after                                 
   parm4 = data_unconv   
                             
   address linkmvs "SNAC2000 parm1 parm2 parm3 parm4"                             
end

Re: Call Assembler from REXX with parameters

PostPosted: Sun Jan 23, 2011 5:44 pm
by NicC
Try taking the quotes of from the parameters - you are passing parm1/2/3/4 not the contents

Re: Call Assembler from REXX with parameters

PostPosted: Sun Jan 23, 2011 10:27 pm
by steve-myers
If you read the fine manual you will find you cannot pick up parameters as though your Assembler program is being called from Cobol.

Re: Call Assembler from REXX with parameters

PostPosted: Sun Jan 23, 2011 11:00 pm
by enrico-sorichetti
I beg to differ, or rather the manuals themselves do... Yes You can
look at the manuals for the IGGCSI00 interface
and You will see that IGGCSI00 is called from assembler with a standard parameter list
and can be called from REXX using the proper form

also for the TS...
see for rexx
sys1_samplib(iggcsirx)
 
 /********************************************************************/ 03100000
 /*                                                                  */ 03150000
 /*  ISSUE LINK TO CATALOG GENERIC FILTER INTERFACE                  */ 03200000
 /*                                                                  */ 03250000
 /********************************************************************/ 03300000
 ADDRESS LINKPGM 'IGGCSI00  MODRSNRC  CSIFIELD  DWORK'                  03350000



the same called from assembler
sys1_samplib(iggcsilc)

         LA    1,PARMLIST                                               02750000
         CALL  IGGCSI00                                                 02800000
         LTR   15,15                        TEST RETURN CODE            02850000

.....
PARMLIST DS    0D                                                       15600000
         DC    A(MODRSNRT)                MODULE/REASON/RETURN          15650000
         DC    A(CSIFIELD)                                              15700000
         DC    A(DATAAREA)                                              15750000

Re: Call Assembler from REXX with parameters

PostPosted: Sun Jan 23, 2011 11:13 pm
by steve-myers
I have used IGGCSI00 from Assembler with considerable success, though that was in 1999 or so.

Re: Call Assembler from REXX with parameters

PostPosted: Tue Jan 25, 2011 10:24 pm
by Pedro
The original post says it needs to pass seven parameters, but the code shown only passes four parameters. What is up with that?