BPX1TRU (truncate) example

The following code truncates the file described by /somedir/somefile.c to a length of 512 bytes. For the callable service, see truncate (BPX1TRU, BPX4TRU) — Change the size of a file. AMODE 64 callers use BPX4TRU (truncate) example.
                                              
         MVC   BUFFERA(20),=CL20'/somedir/somefile.c'                   
         MVC   BUFLENA,=F'20'                                           
         MVC   NEWLEN(8),=FL8'512'                                      
         SPACE ,                                                        
         CALL  BPX1TRU,              Truncate a file                   +
               (BUFLENA,             Input: Pathname length            +
               BUFFERA,              Input: Pathname                   +
               NEWLEN,               Input: Length to keep             +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------