USS Sample - different samples 1

Sample
USS - Sample

Beispiel:                                 

/* REXX YUSSBSP1 Copyright YCOS Yves Colliard Software 1990-2009 */
/* TRACE ?R  */
  /* einschalten des interaktiven Trace Modus */
  /* */
/***  REXX  **********************************************************/
/*  Funktion:  Call some different services                          */
/*********************************************************************/
if syscalls('ON')<>0 then do
  say "Error SYSCALL Enablement!"
  exit
end
address syscall 'time'                /* Ask USS Time: RETVAL*/
say retval  /* nicht direct lesbar.... */
address syscall 'gmtime (retval) gm.' /* Convert retval!     */
if gm.tm_hour=0 then
   h='   '
else
   h=right(gm.tm_hour,2,0)':'
m=right(gm.tm_min,2,0)':'
say "USS :" gm.tm_mday"/"gm.tm_mon"/"gm.tm_year,
    h""m""right(gm.tm_sec,2,0)
say "REXX:" date("E") time()          /* MVS/REXX Date/Time  */
/* */
address syscall 'getuid'              /* Get our UID         */
say 'uid:' RETVAL
address syscall 'getgid'              /* Get our GID         */
say 'gid:' RETVAL
address syscall 'getpid'              /* Get our PID         */
say 'pid:' RETVAL
/* */
say "Before waiting 5 seconds " time()
address syscall 'sleep 5'             /* Wait in USS!        */
say "We were waiting 5 seconds" time()
/* */
address syscall 'getpsent ps.'        /* Get all PS          */
do i=1 to ps.0
  drop gm.
  address syscall 'gmtime (ps.i.ps_starttime) gm.'
  if gm.tm_hour=0 then
     h='   '
   else
     h=right(gm.tm_hour,2,0)':'
  m=right(gm.tm_min,2,0)':'
  say ps.i.ps_cmd ps.i.ps_path ps.i.ps_pid,
      gm.tm_mday"/"gm.tm_mon"/"gm.tm_year h""m""right(gm.tm_sec,2,0)
end