BPX4SPY (setpriority) example

The following code sets the CPU priority based on the input which and who values. The which value used is PRIO_PROCESS, which indicates that the priority is to be set by process ID. The who value used is 7, to set the priority for process ID 7. For the callable service, see setpriority (BPX1SPY, BPX4SPY) — Set the scheduling priority of a process. AMODE 31 callers use BPX1SPY (setpriority) example.
                                              
         MVC   PROCID,=XL4'00000007' Process ID to set priority for     
         MVC   PRIORITY,=XL4'00000001' Priority value of 1              
         SPACE ,                                                        
         CALL  BPX4SPY,              Set priority value                +
               (=A(PRIO_PROCESS),    Input: Set by Process ID          +
               PROCID,               Input: PID to set priority for    +
               PRIORITY,             Input: Priority value to set to   +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ---------------------------------- 
         L     R15,RETVAL            Load return value                  
         C     R15,=F'-1'            Test for -1 return                 
         BE    PSEUDO                Branch on error