<snip>
         SETRP RC=4,RETREGS=YES,RETADDR=(R4),FRESDWA=YES,DUMP=YES,     X 
              RECORD=YES,RUB=(R3),DUMPOPX=SNAPL 

SNAPL    SNAPX DCB=*-*,PDATA=ALL,SDATA=LSQA,LIST=(R7),STRHDR=L1 
</snip>

That is not going to work for at least two reasons. One is that, as Walt 
pointed out, the "LIST" operand isn't going to get set.
The second is that "SNAPL" is not the address of the parameter list in 
this expansion. It is the address of the first instruction of the 
expansion which is a branch around the expansion. And relying on there 
being exactly 4 bytes from SNAPL to the beginning of the parameter area 
staying that way forever would be foolhardy.

If you want to play for now, with no reliance on this working at any time 
in the future, you could consider invoking SNAPX but then having ORG *-2 
after the invocation (and continuing your program from there). The last 
instruction of the expansion happens to be "SVC 51" so you would end up 
no-oping the actual invocation of the service. This too is something that 
would be foolhardy to rely upon.

But if you wanted to try, it would be something like this, assuming a 
reentrant module:
<in your module storage>
SNAPL_STATIC SNAPX MF=L
<in your dynamic storage>
SNAPL_AUTO   SNAPX MF=L
SNAPL_LEN    EQU   *-SNAPL_AUTO
<in your module storage>
             MVC   SNAPL_AUTO(SNAPL_LEN),SNAPL_STATIC
             SNAPX <all_your_options>,MF=(E,SNAPL_AUTO)
             ORG   *-2
             SETRP <all_your_options>,DUMPOPX=SNAPL_AUTO

Or, use the list form of SNAPX, examine the expansion of an execute form 
of SNAPX that does any piece that the list form that you can't do (such as 
the processing of LIST=(R7) ), and code that yourself to update your list 
form (and/or use the IHASNAPX macro from 'sys1.modgen' to help do that if 
you want your code to be more readable). This approach, if you get it 
right, will likely work forever, unclean as it might be, because you are 
producing exactly the same parameter area that would have been passed to 
the SNAP service. But only if you get every bit and byte correct.

You won't need to specify DCB for this SNAPX. That information is not used 
for SETRP DUMPOPX.

Peter Relson
z/OS Core Technology Design

Reply via email to