Better than QRWOPTIONS

This program allows you to decide if you want to log, dump, or use a QAQQINI file for a job.

This Content Component encountered an error

This program should be added in the DDMACC parameter of the CHGNETA. It allows you to decide if you want to log, dump, or use a QAQQINI file for a job -- depending on the profile or the IP address. Just fill the WRKDDMJOB with the same setup as the QRWOPTIONS DTAARA. The benefit is you can manage several profiles and addresses.

Using '*CND WRKDDMJOB':

To use this program, just set up the DDMACC field of the Network attributes. Then set up the WRKDDMJOB file:

 
O_ADRIP       15A : IP address to manage
O_IGNOR        1A : not used
O_PROFI       10A : user to manage
O_JOBLO        1A : I or U, to produce a log
O_DSPJO        1A : not used yet
O_TRACE        1A : not used yet
O_DEBUG        1A : I or U, to start debug
O_QRYA         1A : I or U, to use the QAQQINI file in the O_ QAQQI library
O_SHADO        1A : not used yet
O_TRAC2        1A : not used yet
O_RESER        1A : not used
O_QAQQI       10A : library where is stored the QAQQINI file

This is the same set up as the QRWOPTIONS DTAARA, but now I can manage several users and several IP addresses.

 
H DATFMT(*YMD/)  TIMFMT(*HMS:)

FWRKDDMJOB if   e             disk
 *
D pgmsds         sds
D  curjob               244    253
D  curprf               254    263
D  curnbr               264    269  0
D  curnbr_c                      6a   overlay(curnbr)
 *
D cde             s            100
D lg              s             15  5 inz(0)
 *
D curip           s             15
 *
D Struct          DS
D  user                         10a
D  appli                        10a
D  subappli                     10a
D  object                       10a
D  library                      10a
D  member                       10a
D  format                       10a
D  length                        5s 0
D  remloc                       10a
D  remname                      10a
D  other                      2000a
D ddmmap          DS
D  input                         1a
D  output                        1a
D  update                        1a
D  delete                        1a
D  objname                      12a
D  dirname                      63a
D  command                    1921a
D drdamap         DS
D  applireq                      9a
D  product                       3a
D  versionid                     2a
D  releaseid                     2a
D  modifid                       1a
D  reserved                   1983a
 *--- API : variables globales
D @usrspcname     s             20    inz('USRSPC    QTEMP     ')
D @format         s              8
D @error          s              7
D @struct         ds
D  #strpos                1      4b 0
D  #lendta                5      8b 0
D  $ussize                9     12b 0
 *--- API QUSRJOBI : retrieve job informations
D @usrjobi        s            322
D @intjobi        s             26
D @qualjobname    s             26
 *
C     *ENTRY        PLIST
C                   PARM                    rtncode           1
C                   PARM                    param          3000
 *
C                   call      'QUSDLTUS'
C                   parm                    @usrspcname
C                   parm                    @error
 *
C                   call      'QUSCRTUS'
C                   parm                    @usrspcname
C                   parm      *blanks       $attr            10
C                   parm      10000         $ussize
C                   parm      x'00'         $usinit           1
C                   parm      '*ALL    '    $usauth          10
C                   parm                    $ustext          50
 *
C                   eval      %subst(@qualjobname:1:10)=curjob
C                   eval      %subst(@qualjobname:11:10)=curprf
C                   eval      %subst(@qualjobname:21:6)=curnbr_c
 *
C                   call      'QUSRJOBI'
C                   parm                    @usrjobi
C                   parm      322           #lendta
C                   parm      'JOBI0600'    @format
C                   parm                    @qualjobname
C                   parm                    @intjobi
 *
C                   eval      curip=%subst(@usrjobi:308:15)
 *
C                   eval      struct=param

 *
C                   read      WRKDDMJOB                            1010
C                   dow       not *in10
 *
C                   if        curip=o_adrip or user=o_profi
 *

C                   if        curip=o_adrip

C                   if        o_qrya='I' and o_qaqqi<>' '

C                   eval      cde='CHGQRYA QRYOPTLIB(' +

C                             %trim(o_qaqqi) + ')'

C                   exsr      execute

C                   endif

C                   if        o_joblo='I'

C                   eval      cde='CHGJOB LOG(4 00 *SECLVL)
LOGCLPGM(*YES)'
C                   exsr      execute

C                   endif

C                   if        o_debug='I'

C                   eval      cde='STRDBG UPDPROD(*YES)'

C                   exsr      execute

C                   endif

C                   endif

 *

C                   if        user=o_profi

C                   if        o_qrya='U' and o_qaqqi<>' '

C                   eval      cde='CHGQRYA QRYOPTLIB(' +

C                             %trim(o_qaqqi) + ')'

C                   exsr      execute

C                   endif

C                   if        o_joblo='U'

C                   eval      cde='CHGJOB LOG(4 00 *SECLVL)
LOGCLPGM(*YES)'
C                   exsr      execute

C                   endif

C                   if        o_debug='U'

C                   eval      cde='STRDBG UPDPROD(*YES)'

C                   exsr      execute

C                   endif

C                   endif

 *

C                   endif

 *

C  N10              read      WRKDDMJOB                            1010

C                   enddo

 *

C                   move      '1'           rtncode

 *

C                   seton                                            LR
 *
C     execute       begsr
C                   eval      lg=%len(%trim(cde))
C                   call      'QCMDEXC'
C                   parm                    cde
C                   parm                    lg
C                   eval      *in10='1'
C                   endsr


A          R OPTIONS
A            O_ADRIP       15A
A            O_IGNOR        1A
A            O_PROFI       10A
A            O_JOBLO        1A
A            O_DSPJO        1A
A            O_TRACE        1A
A            O_DEBUG        1A
A            O_QRYA         1A
A            O_SHADO        1A
A            O_TRAC2        1A
A            O_RESER        1A
A            O_QAQQI       10A






==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your systems management questions fast.

Read this Search400.com Featured Topic: Take control of your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.


This was first published in March 2005

Dig deeper on iSeries programming commands

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close