Thanks done  

The   org *-2 wipes the SVC 

MVC   SNAPL_AUTO(SNAPL_LEN),SNAPL_STATIC                  
 L     R7,START1                                           
 SETRP RC=4,RETREGS=YES,RETADDR=(R4),FRESDWA=YES,DUMP=YES, 
       RECORD=YES,RUB=(R3),DUMPOPX=SNAPL_AUTO              
SNAPL_AUTO   SNAPX MF=L      
SNAPL_AUTO DS  0F            
         DC    AL1(0)        
         DC    AL1(112)      
         DC    AL1(133)      
         DC    AL1(1)        
          DC    AL1(0)        
         DC    AL1(0)        
         DC    AL1(0)        
         DC    AL1(0)        
         DC    A(0)          
         DC    A(0)          
         DC    A(0)          
         DC    A(0)        
  
SNAPX DCB=*-*,PDATA=ALL,SDATA=LSQA,LIST=(R7),STRHDR=L1,  
      MF=(E,SNAPL_AUTO)                                  
LA    1,SNAPL_AUTO                                       
MVI   3(1),1               SET VERSION NUMBER            
LA    0,*-*                GET DCB ADDRESS @L1C          
ST    0,8(0,1)             STORE INTO PARAMETER LIST    Y
OI    1(1),115            SET OPTION FLAGS              Y
OI    2(1),133            SET OPTION FLAG 2           @G8
MVI   4(1),32             SET OPTION FLAGS              Y
MVI   5(1),0              SET OPTIONS FLAGS            G3
MVI   6(1),191            SET OPTION FLAGS              Y
                                                         
  SDWARC1,R8  DBGREST,R12,R3  WS_DSECT,R13               
Statement                                  HLASM R6.0  20
ST    (R7),16(0,1)  SNAPSHOT LIST ADDR INTO PARAM LIST  Y
LA    0,L1          GET HEADER ADDRESS                 G3
ST    0,20(0,1)     STORE HEADER ADDRESS               G3
SVC   51                                                 
ORG   *-2                                                
-----Original Message-----
From: IBM Mainframe Assembler List <[email protected]> On
Behalf Of Peter Relson
Sent: Thursday, November 8, 2018 12:16 PM
To: [email protected]
Subject: Re: Snap Macro Assembler error ? Here it is thanks

<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