Call Assembler from REXX with parameters



IBM's Command List programming language & Restructured Extended Executor

Re: Call Assembler from REXX with parameters

Postby alexm » Thu Jan 13, 2011 12:19 am

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)
User avatar
alexm
 
Posts: 35
Joined: Wed Oct 13, 2010 6:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Call Assembler from REXX with parameters

Postby dick scherrer » Thu Jan 13, 2011 12:34 am

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 :)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Call Assembler from REXX with parameters

Postby Pedro » Thu Jan 13, 2011 2:29 am

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
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Call Assembler from REXX with parameters

Postby steve-myers » Thu Jan 13, 2011 11:11 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Call Assembler from REXX with parameters

Postby Greenhouse » Sun Jan 23, 2011 12:53 pm

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
Greenhouse
 
Posts: 25
Joined: Tue Sep 02, 2008 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Call Assembler from REXX with parameters

Postby NicC » Sun Jan 23, 2011 5:44 pm

Try taking the quotes of from the parameters - you are passing parm1/2/3/4 not the contents
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Call Assembler from REXX with parameters

Postby steve-myers » Sun Jan 23, 2011 10:27 pm

If you read the fine manual you will find you cannot pick up parameters as though your Assembler program is being called from Cobol.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Call Assembler from REXX with parameters

Postby enrico-sorichetti » Sun Jan 23, 2011 11:00 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Call Assembler from REXX with parameters

Postby steve-myers » Sun Jan 23, 2011 11:13 pm

I have used IGGCSI00 from Assembler with considerable success, though that was in 1999 or so.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Call Assembler from REXX with parameters

Postby Pedro » Tue Jan 25, 2011 10:24 pm

The original post says it needs to pass seven parameters, but the code shown only passes four parameters. What is up with that?
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

PreviousNext

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post