RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

QUSRJOBI API to tell if program running interactive or batch environment Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

Sample from Jamie Flanary (www.code400.com)


     D IsIntJob        PR             1N
     D Msg             S             50A

     c                   if        IsIntJob
     c                   eval      Msg = 'Interactive job'
     c                   dsply                   Msg
     c                   else
     c                   eval      Msg = 'Non-interactive job.'
     c     Msg           dsply
     c                   endif

     c                   eval      *inlr = *on

      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      *   IsIntJob   --   Is this an interactive job?
      *        returns *ON if job is interactive
      *            or  *OFF if job is not interactive.
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P IsIntJob        B                   export
     D IsIntJob        PI             1N

     D QUSRJOBI        PR                  EXTPGM('QUSRJOBI')
     D   RcvVar                   32766A   options(*varsize)
     D   RcvVarLen                   10I 0 const
     D   Format                       8A   const
     D   QualJob                     26A   const
     D   InternJob                   16A   const
     D   ErrorCode                32766A   options(*nopass:*varsize)

     D dsJob           DS
     D  dsJobBytesRtn                10I 0
     D  dsJobBytesAvl                10I 0
     D  dsJobName                    10A
     D  dsJobUser                    10A
     D  dsJobNumber                   6A
     D  dsJobIntern                  16A
     D  dsJobStatus                  10A
     D  dsJobType                     1A
     D  dsJobSubtype                  1A
     D  dsJobReserv1                  2A
     D  dsJobRunPty                  10I 0
     D  dsJobTimeSlc                 10I 0
     D  dsJobDftWait                 10I 0
     D  dsJobPurge                   10A

     c                   callp     QUSRJOBI(dsJob: %size(dsJob):'JOBI0100': 
     c                                   '*': *blanks)
     c                   if        dsJobType = 'I'
     c                   return    *ON
     c                   else
     c                   return    *OFF
     c                   endif
     P                 E


User Comments

Please login or register to add comments

<Previous   Next>