BPX4CHR (chattr) example

The following code changes the attributes of /somedir/somefile.c. The owning user and group ids are changed; the file change time is set to the current time; and the user read-execute, group write, and other read-execute permissions are set. For the callable service, see chattr (BPX1CHR, BPX4CHR) — Change the attributes of a file or directory. For the data structures, see BPXYATT — Map file attributes for chattr and fchattr and BPXYMODE — Map the mode constants of the file services. AMODE 31 callers use BPX1CHR (chattr) example.
                                              
         MVC   BUFFERA(20),=CL20'/somedir/somefile.c'                   
         MVC   BUFLENA,=F'20'                                           
         MVC   ATTID,=CL4'ATT '      Eye Catcher                        
         MVC   ATTVERSION,=AL2(ATT#VER)  version                        
         XC    S_MODE,S_MODE         Clear mode                         
         MVI   S_MODE2,S_IRUSR       Read-execute/write/read-execute    
         MVI   S_MODE3,S_IXUSR+S_IWGRP+S_IROTH+S_IXOTH                  
         MVC   ATTMODE,S_MODE        Move mode data to attribute       +
               structure                                                
         MVC   ATTUID,=F'7'          Specify new UID                    
         MVC   ATTGID,=F'77'         Specify new GID                    
         OI    ATTSETFLAGS1,ATTMODECHG+ATTOWNERCHG                     +
               Flag Mode, UID and GID changes                           
         OI    ATTSETFLAGS2,ATTCTIMETOD                                +
               Set change time to current time                          
         SPACE ,                                                        
         CALL  BPX4CHR,              Change file attributes            +
               (BUFLENA,             Input: Pathname length            +
               BUFFERA,              Input: Pathname                   +
               =A(ATT#LENGTH),       Input: BPXYATT length             +
               ATT,                  Input/output: BPXYATT             +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------