Page 1 of 1

ISRE741 Command not executed

PostPosted: Fri Apr 17, 2020 12:46 am
by Sandeep1311
Hi,

I am trying to use MACRO for easy DNAME execution. while submitting the macro I have below.



* Command in error . : MACRO(VIEW)                                           *
 *                                                                            *
 * Command not executed                                                       *
 * An ISREDIT MACRO statement must precede any executable statements.         *
 *                                                                            *
 *   Error message ID . : ISRE741                                             *
 *                                                                            *
 *   Last return code . : 28                                                  *
 *                                                                            *
 *   Macro executing  . : SRTOL                                               *
 *                                                                            *
 * Press ENTER key to terminate the macro.                                    *
 *                                                                            *
 


I checked on IBM Knowledge center and the issue explanation state

The macro name you entered does not have the ISREDIT MACRO statement as the first executable instruction

I checked my program.


/* REXX */                                                  
 ADDRESS ISREDIT                                            
 "MACRO(VIEW)"                                              
 "(CURL,CURC) = CURSOR"                                      
 "(LINEDATA) = LINE" CURL                                    
 PARSE VAR LINEDATA BEQUAL '=' DSNAME ','                    
  IF SYSDSN("'"DSNAME"'") = 'OK' THEN                        
   DO                                                        
     SELECT                                                  
       WHEN VIEW = 'E' THEN                                  
         DO                                                  
           ADDRESS ISPEXEC "EDIT DATASET('"DSNAME"')"        
         END                                                
       WHEN VIEW = 'V' THEN                                  
         DO                                                  
           ADDRESS ISPEXEC "VIEW DATASET('"DSNAME"')"        
         END                                                
       WHEN VIEW = 'B' THEN                                  
         DO                                                  
           ADDRESS ISPEXEC "BROWSE DATASET('"DSNAME"')"      
         END                                                
       WHEN VIEW = 'D' THEN                                  
         DO                                                  
           ADDRESS TSO "DELETE '"DSNAME"'"                  
         END                                                
       OTHERWISE                                            
         DO                                                  
           SAY 'PLEASE SELECT APPRPIATE OPTION'              
         END                                                
     END                                                    
   END                                                      
  ELSE                                                      
   DO                                                        
     SAY 'DATSET IS NOT FOUND'                              
   END                                                      



please advise.

Re: ISRE741 Command not executed

PostPosted: Fri Apr 17, 2020 2:32 am
by Terry Heinze
Not a REXX expert, but try changing your 2nd line to:
Address isredit "MACRO"

Re: ISRE741 Command not executed

PostPosted: Fri Apr 17, 2020 2:36 am
by sergeyken
RTFM: https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3sc193621/$file/f54em00_v2r3.pdf

The described syntax requires the operation code MACRO to be separated by at least one blank from its other options and/or parameters.

Re: ISRE741 Command not executed

PostPosted: Fri Apr 17, 2020 3:42 pm
by Sandeep1311
ADDRESS ISREDIT "MACRO (VIEW)" is fine now thank you for help

Re: ISRE741 Command not executed

PostPosted: Fri Apr 17, 2020 5:44 pm
by willy jensen
To clarify, "first executable instruction" in the statement "The macro name you entered does not have the ISREDIT MACRO statement as the first executable instruction" really means "first executable EDIT instruction. The following REXX statement sequence is perfectly ok:

/* rexx */                          
  address ispexec                    
  "control errors return"            
  ADDRESS ISREDIT "MACRO (P) PROCESS"
  if rc=0 then do                    
    address isredit                  
    "(sds) = dataset"                
    "(smb) = member "                
  end                                
  else do                            
    arg sds                          
    parse var sds . =2 sds'('smb')'.  
  end