sponsored links

Collapse

Announcement

Collapse
No announcement yet.

QCLRPGMI API to Retrieve program info

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • QCLRPGMI API to Retrieve program info

    Here is Example of API to return program information

    I attached code for easy download


    Code:
    À     *                                                                                            Ä
    À     * Program Info                                                                               Ä
    À     *                                                                                            Ä
         d                SDS
         d  @PGM                 001    010
         d  @PARMS               037    039  0
         d  @JOB                 244    253
         d  @USER                254    263
         d  @JOB#                264    269  0
          *=============================================
          *   QCLRPGMI  API to Retrieve program info
          *=============================================
          *
          * Standard API error data structure
          *
         d APIERR          DS                  INZ
         d  AEBYPR                 1      4B 0
         d  AEBYAV                 5      8B 0
         d  AEEXID                 9     15
         d  AEEXDT                16    116
          *
          * Standard parameters for QCLRPGMI                                API
          * (Retrieve Program Information)                                  API
          *
         d RP_PARM         DS                  INZ
         d  RP_RCV                 1    416                                         RECEIVER VARIABLE
         d   RP_PGMNAME            9     18                                         PROGRAM NAME
         d   RP_PGMLIB            19     28                                         PROGRAM LIBRARY
         d   RP_PGMATTR           39     48                                         PROGRAM ATTRIBUTE
         d   RP_TEXT             111    160                                         TEXT DESCRIPTION
         d   RP_MODULES          413    416B 0                                      NUMBER OF MODULES
         d  RP_RCV_LEN           417    420B 0                                      LENGTH OF RCV VAR
         d  RP_FORMAT            421    428                                         FORMAT NAME
         d  RP_PGM_LIB           429    448                                         PGM NAME & LIBRARY
         d   RP_PGM              429    438                                         PROGRAM NAME
         d   RP_LIB              439    448                                         PROGRAM LIBRARY
          *
          * Define Variables
          *
         d InLibrary       S             10
         d InProgram       S             10
          *
         c                   clear                   RP_parm
         c                   eval      RP_RCV_LEN = 416
         c                   eval      RP_FORMAT  = 'PGMI0100'
         c                   eval      RP_PGM     = InProgram
         c                   eval      RP_LIB     = InLibrary
         c                   clear                   APIERR
         c                   eval      AEBYPR     = 116
          *
         c                   call      'QCLRPGMI'
         c                   parm                    RP_RCV
         c                   parm                    RP_RCV_LEN
         c                   parm                    RP_FORMAT
         c                   parm                    RP_PGM_LIB
         c                   parm                    APIERR
          *
         c                   eval      *INLR = *On
          *
          *=============================================
          *   *Inzsr - Initial onetime subroutine
          *=============================================
         csr   *Inzsr        begsr
          *
         c     *Entry        Plist
         c                   parm                    InLibrary
         c                   parm                    InProgram
          *
         c                   endsr
          *=============================================
    Attached Files
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

sponsored links

Collapse

Working...
X