CPYMSGDRPG

CPYMSGDRPG

CPYMSGDRPG
 
/********************************************************************/
/*       PROGRAM NAME:   CPYMSGDRPG                                 */
/*       DATE WRITTEN:   10/26/2001                                 */
/*       AUTHOR......:   Vijayakumar kannan                         */
/*       FUNCTION....:   This is used to copy message description   */
/*                       from one lpar/system to another lpar/system*/
/*                                                                  */
/********************************************************************/
     D #MsgInfo        DS
     D  ALLMSG                    32767
     D  BytesRet               1      4B 0
     D  BytesAvail             5      8B 0
     D  MsgSevL                9     12B 0
     D  AlertIndex            13     16B 0
     D  AlertOpt              17     25
     D  LogInd                26     26
     D  MsgID                 27     33
     D  Reserved1             34     36
     D  #SVarFmt              37     40B 0
     D  CCSIDText             41     44B 0
     D  CCSIDData             45     48B 0
     D  CCSIRText             49     52B 0
     D  OSDftRep              53     56B 0
     D  LDftRepR              57     60B 0
     D  LDftRepA              61     64B 0
     D  OSMsg                 65     68B 0
     D  LMsgR                 69     72B 0
     D  LMsgA                 73     76B 0
     D  OSMsgH                77     80B 0
     D  LMsgHR                81     84B 0
     D  LMsgHA                85     88B 0
     D  OSSVFmt               89     92B 0
     D  LSVFmtR               93     96B 0
     D  LSVFmtA               97    100B 0
     D  LSVFmtE              101    104B 0

     D  #MsgTxt        S            132
     D  #HELPTXT       S           3000

     D  #SUBSTVAR      DS
     D   #SUBLEN               1      4B 0
     D   #SUBDEC               5      8B 0
     D   #SUBTYP               9     16A
     D   #FILL1               17     18A

     D   #FMTDTA       DS
     D   #TYP                  1      8A
     D   #blank1               9      9A
     D   #LEN                 10     14  0
     D   #blank2              15     15A
     D   #DEC                 16     16  0

     D #Error          DS
     D  EBytesP                1      4B 0 INZ(40)
     D  EBytesA                5      8B 0
     D  EMsgID                 9     15
     D  EReserverd            16     16
     D  EData                 17     56

     D #QualMsgf1      DS
     D #FrmMsgFile             1     10A
     D #FrmMsgfLib            11     20A

     D #QualMsgf2      DS
     D #ToMsgFile              1     10A
     D #ToMsgfLib             11     20A

     D #LPARS          DS
     D #bin_lpar               1      2B 0
     D #sysname                3     42A

     D #ToMsgId        S                   LIKE(#FrmMsgid)
     D #num_lpar       S              2P 0
     D #SEV_NUM        S              2P 0
     D #FMT_LIST       S           1000A
     D #idx            S              3  0 INZ
     D Ucase           C                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
     D Lcase           C                   'abcdefghijklmnopqrstuvwxyz'

     D  #InfoLen       S              9B 0 INZ(1000)
     D  #FmtName       S              8    INZ('RTVM0300')
     D  #FrmMsgId      S              7
     D  #RepData       S              1    INZ(' ')
     D  #RepLenDta     S              9B 0 INZ(1)
     D  #RecLen        S              9B 0 INZ(1040)
     D  #RSubstVal     S             10    INZ('*NO')
     D  #RetFmtChr     S             10    INZ('*NO')
     D  #RtvOpt        S             10    inz('*MSGID')
     D  #CCSIDC        S              9B 0 INZ(0)
     D  #CCSIDR        S              9B 0 INZ(0)

      *------------------------------------------------------------*
     c                   exsr      $rtvmsg

     C                   EVAL      #MsgTxt = %SUBST(allmsg:Osmsg+1:LMsgR)

     C                   IF        lmsghr > 0
     C                   EVAL      #HelpTxt = %SUBST(allmsg:Osmsgh+1:LMsgHR)
     C                   ENDIF

     C                   IF        lSVFMTR > 0

     C                   FOR       #IDX = 1 TO #SVARFMT
     C                   EVAL      #SubSTVAR = 
%SUBST(allmsg:Ossvfmt+1:LSVFMTE)
     C                   EVAL      #TYP  =    #SUBTYP
     C                   MOVE      #SUBLEN       #LEN
     C                   MOVE      #SUBDEC       #DEC

     c                   if        #idx = 1
     c                   eval      #fmt_list = '(' + #FMTDTA + ')'
     c                   else
     c                   eval      #fmt_list = %trim(#fmt_list) +
     c                                         '(' + #FMTDTA + ')'
     c                   endif

     C                   EVAL      OSSVFMT = (OSSVFMT + lSVFMTE)
     C                   ENDFOR

     C                   ENDIF

     C                   EVAL      #SEV_NUM = msgsevl

     c                   if        #tomsgid <> *blanks
     c                   eval      #FrmMsgid = #tomsgid
     c                   endif

     c                   if        #tomsgfile <> *blanks
     c                   eval      #frmmsgfile =  #tomsgfile
     c                   eval      #frmmsgflib = #tomsgflib
     c                   endif

     c                   exsr      $cpymsg

     c                   eval      *inlr = *on
      *------------------------------------------------------------*
      * Retrieve Message API                                       *
      *------------------------------------------------------------*
     C     $RTVMSG       BEGSR
     C                   CALL      'QMHRTVM'
     C                   PARM                    #MsgInfo
     C                   PARM                    #InfoLen
     C                   PARM                    #FmtName
     C                   PARM                    #FrmMsgID
     C                   PARM                    #QualMsgf1
     C                   PARM                    #RepData
     C                   PARM                    #RepLenDta
     C                   PARM                    #RSubstval
     C                   PARM                    #RetFmtChr
     C                   PARM                    #Error
     C                   PARM                    #RtvOpt
     C                   PARM                    #CCSIDC
     C                   PARM                    #CCSIDR
     c                   Endsr
      *------------------------------------------------------------*
      * Copy Message id to the to msgid entered by the user        *
      *------------------------------------------------------------*
     C     $cpymsg       BEGSR
     C                   CALL      'CPYMSGDCLP'
     C                   PARM                    #FrmMsgid
     C                   PARM                    #FrmMSGFILE
     C                   PARM                    #FrmMSGFLIB
     C                   PARM                    #MSGTXT
     C                   PARM                    #HELPTXT
     C                   PARM                    #SEV_NUM
     C                   PARM                    #FMT_LIST
     C                   PARM                    #NUM_LPAR
     C                   PARM                    #sysname
     c                   Endsr
      *-------------------------------------------------------------*
      * Initialization                                              *
      *-------------------------------------------------------------*
     C     *INZSR        BEGSR

     C     *ENTRY        PLIST
     C                   PARM                    #FrmMsgid
     C                   PARM                    #QualMsgf1
     C                   PARM                    #ToMsgid
     C                   PARM                    #QualMsgf2
     c                   PARM                    #LPARS
     C                   EVAL      #NUM_LPAR = #BIN_LPAR
     C                   EVAL      #SYSNAME = %SUBST(#SYSNAME:1:10 * 
#NUM_LPAR)
     C                   ENDSR
  

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