Rexx to Save in View Mode

 

REXX TO SAVE A MEMBER OF PDS IN VIEW MODE
 
The following REXX code can be used to save a member in VIEW mode. Although you can save a member using ISPF commands while viewing the datasets also (refer Saving in View Mode)
; ; ; ;
 
 
/*REXX*/
"ISREDIT MACRO "                                 
"ISPEXEC CONTROL ERRORS RETURN"                  
X = MSG("OFF")                                   
  "ISREDIT (PDSNAME) = DATASET"                  
  "ISREDIT (MEMNAME) = MEMBER"                   
    VPDS = "'"PDSNAME"("MEMNAME")'"              
      Y = LISTDSI("'"PDSNAME"'")                 
      IF SYSDSORG = "PO" THEN                    
         DO                                      
         "ISREDIT REPL .ZF .ZL " MEMNAME         
         IF RC = 0 THEN                          
         ZEDLMSG =  MEMNAME 'SAVED!'             
         ELSE                                    
         ZEDLMSG =  MEMNAME ' NOT SAVED!'        
         "ISPEXEC SETMSG MSG(ISRZ001)"           
         END