WTO directly from Rexx

  • Post category:Rexx
  • Post comments:0 Comments

There are probably more ways do write a message in the system log – “Write to Operator” from a Rexx script.

This is a very straightforward one I found some time ago somewhere on the Interweb.

/* rexx */                                           
trace r                                              
call syscalls 'ON'                                   
address syscall                                      
'open' path O_wronly 666                             
if retval=-1 then                                    
say 'file not opened, error codes' errno errnojr     
rec= 'This is my message text to appear in the system log.' || esc_n                            
'write' fd 'rec' length(rec)                         
if retval=-1 then                                    
say 'record not written, error codes' errno errnojr  
'close' fd                                           

Have more solutions? Or remarks? Please let me know below.

Leave a Reply