ID #1118

OUTQの移動

OUTQに溜ったスプールファイルを一括で別のOUTQに移動します。

 
                            OUTQ の移動  (MOVOUTQ)                             
                                                                                
  選択項目を入力して,実行キーを押してください。                                
                                                                                
 FROM OUTQ  . . . . . . . . . . .                  名前                         
   LIBRARY  . . . . . . . . . . .     *LIBL        文字値                       
 TO OUTQ  . . . . . . . . . . . .                  名前                         
   LIBRARY  . . . . . . . . . . .     *LIBL        文字値                       
  スプールファイル  . . . . . . .   *ALL           名前,総称* , *ALL          
  ユーザーデータ  . . . . . . . .   *ALL           文字値 , *ALL                
  ユーザー  . . . . . . . . . . .   *ALL           名前 , *ALL                  
  ステータス  . . . . . . . . . .   *ALL          *RDY, *HLD, *SAV, *ALL...     
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                         終り   
 F3= 終了    F4=プロンプト   F5= 最新表示    F12= 取消し    F13= この画面の使用法  
 F24= キーの続き                                                                
                                                                                



コンパイル手順

  CRTPF FILE(xxxxx/MOVOUTQP) SRCFILE(xxxxx/QDDSSRC) SRCMBR(MOVOUTQP)

  CRTCLPGM   PGM(xxxxx/MOVOUTQC) +
               SRCFILE(xxxxx/QCLSRC)

  CRTBNDRPG  PGM(xxxxx/MOVOUTQR1) +
               SRCFILE(xxxxx/QRPGLESRC)

  CRTBNDRPG  PGM(xxxxx/MOVOUTQR2) +
               SRCFILE(xxxxx/QRPGLESRC)

  
  CRTCMD     CMD(xxxxx/MOVOUTQ) PGM(xxxxx/MOVOUTQC) +
               SRCFILE(xxxxx/QCMDSRC) 

CMD: MOVOUTQ
             CMD        PROMPT('OUTQの移動')
             PARM       KWD(OUTQ) TYPE(NAME2) MIN(1) PROMPT('FROM +
                          OUTQ')
             PARM       KWD(TOOUTQ) TYPE(NAME2) MIN(1) PROMPT('TO +
                          OUTQ')
             PARM       KWD(FILE) TYPE(*GENERIC) LEN(10) DFT(*ALL) +
                          SPCVAL((*ALL ' ')) +
                          PROMPT('スプールファイル')
             PARM       KWD(USRDTA) TYPE(*CHAR) LEN(10) DFT(*ALL) +
                          SPCVAL((*ALL ' ')) CASE(*MIXED) +
                          PROMPT('ユーザーデータ')
             PARM       KWD(USER) TYPE(*SNAME) DFT(*ALL) +
                          SPCVAL((*ALL ' ')) PROMPT('ユーザー')
             PARM       KWD(STATUS) TYPE(*CHAR) LEN(6) RSTD(*YES) +
                          DFT(*ALL) VALUES(*ALL *HLD *SAV *RDY) +
                          SPCVAL((*RDY *READY) (*HLD *HELD) (*SAV +
                          *SAVED)) PROMPT('ステータス')
 NAME2:      QUAL       TYPE(*SNAME) LEN(10)
             QUAL       TYPE(*CHAR) LEN(10) DFT(*LIBL) +
                          PROMPT('LIBRARY')


CL:MOVOUTQC
 PGM PARM(&QUALOUTQ &TOQUALOUTQ &FILE &USRDTA &USER &STATUS)
  DCL        VAR(&QUALOUTQ)     TYPE(*CHAR) LEN(20)
  DCL        VAR(&TOQUALOUTQ)   TYPE(*CHAR) LEN(20)
  DCL        VAR(&OUTQ)         TYPE(*CHAR) LEN(10)
  DCL        VAR(&OUTQLIB)      TYPE(*CHAR) LEN(10)
  DCL        VAR(&TOOUTQ)       TYPE(*CHAR) LEN(10)
  DCL        VAR(&TOOUTQLIB)    TYPE(*CHAR) LEN(10)
  DCL        VAR(&FILE)         TYPE(*CHAR) LEN(10)
  DCL        VAR(&RTNLIB)       TYPE(*CHAR) LEN(10)
  DCL        VAR(&USRDTA)       TYPE(*CHAR) LEN(10)
  DCL        VAR(&USER)         TYPE(*CHAR) LEN(10)
  DCL        VAR(&STATUS)       TYPE(*CHAR) LEN(6)
  CHGVAR     VAR(&OUTQ) VALUE(%SST(&QUALOUTQ 1 10))
  CHGVAR     VAR(&OUTQLIB) VALUE(%SST(&QUALOUTQ 11 10))
  CHKOBJ     OBJ(&OUTQLIB/&OUTQ) OBJTYPE(*OUTQ)
  MONMSG     MSGID(CPF9801 CPF9810) EXEC(DO)
   SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('FROM +
                 OUTQがみつかりません。')  MSGTYPE(*ESCAPE)
   ENDDO
  CHGVAR     VAR(&TOOUTQ) VALUE(%SST(&TOQUALOUTQ 1 10))
  CHGVAR     VAR(&TOOUTQLIB) VALUE(%SST(&TOQUALOUTQ 11 10))
  CHKOBJ     OBJ(&TOOUTQLIB/&TOOUTQ) OBJTYPE(*OUTQ)
  MONMSG     MSGID(CPF9801 CPF9810) EXEC(DO)
   SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('TO +
                 OUTQがみつかりません。')  MSGTYPE(*ESCAPE)
   ENDDO

  CHKOBJ     OBJ(QTEMP/MOVOUTQP) OBJTYPE(*FILE)
  MONMSG     MSGID(CPF9801) EXEC(DO)
    RTVOBJD    OBJ(MOVOUTQP) OBJTYPE(*FILE) RTNLIB(&RTNLIB)
    CRTDUPOBJ  OBJ(MOVOUTQP) FROMLIB(&RTNLIB) +
                 OBJTYPE(*FILE) TOLIB(QTEMP)
  ENDDO
  OVRDBF     FILE(MOVOUTQP) TOFILE(QTEMP/MOVOUTQP)
  CALL       PGM(MOVOUTQR1) PARM('*ALL' &QUALOUTQ '*REPLACE')

  CALL       PGM(MOVOUTQR2) PARM(&TOQUALOUTQ &FILE &USRDTA &USER +
                &STATUS)
  DLTOVR     FILE(MOVOUTQP)
  RETURN
END:
ENDPGM


RPGLE:MOVOUTQR1
      **********************************************************************************************
     FMOVOUTQP  O    E             DISK    USROPN
      **********************************************************************************************
     D ARR             S              1    BASED(LSTPTR) DIM(32767)
     D KEYS            S              9B 0 DIM(20)
      **********************************************************************************************
     DQUSEC            DS
     D QUSBPRV                 1      4B 0
     D QUSBAVL                 5      8B 0
     D QUSEI                   9     15
     D QUSERVED               16     16
      *
     D                 DS
     D SPOOLNBR#                      9B 0
     D  SPOOLNBRCHR                   4    OVERLAY(SPOOLNBR#)
      *
     D                 DS
     D TOTPAGES#                      9B 0
     D  TOTPAGESCHR                   4    OVERLAY(TOTPAGES#)
      *
     D                 DS
     D CURPAGE#                       9B 0
     D  CURPAGECHR                    4    OVERLAY(CURPAGE#)
      *
     D                 DS
     D COPIESLEFT#                    9B 0
     D  COPIESLEFTCHR                 4    OVERLAY(COPIESLEFT#)
      *****************************************************************
     DQUSH0100         DS                  BASED(SPCPTR)
      *                                             QUS GENERIC HEADER 0100
     D QUSUA                         64
      *                                             USER AREA
     D QUSSGH                         9B 0
      *                                             SIZE GENERIC HEADER
     D QUSSRL                         4
      *                                             STRUCTURE RELEASE LEVEL
     D QUSFN                          8
      *                                             FORMAT NAME
     D QUSAU                         10
      *                                             API USED
     D QUSDTC                        13
      *                                             DATE TIME CREATED
     D QUSIS                          1
      *                                             INFORMATION STATUS
     D QUSSUS                         9B 0
      *                                             SIZE USER SPACE
     D QUSOIP                         9B 0
      *                                             OFFSET INPUT PARAMETER
     D QUSSIP                         9B 0
      *                                             SIZE INPUT PARAMETER
     D QUSOHS                         9B 0
      *                                             OFFSET HEADER SECTION
     D QUSSHS                         9B 0
      *                                             SIZE HEADER SECTION
     D QUSOLD                         9B 0
      *                                             OFFSET LIST DATA
     D QUSSLD                         9B 0
      *                                             SIZE LIST DATA
     D QUSNBRLE                       9B 0
      *                                             NUMBER LIST ENTRIES
     D QUSSEE                         9B 0
      *                                             SIZE EACH ENTRY
     D QUSSIDLE                       9B 0
      *                                             CCSID LIST ENT
     D QUSCID                         2
      *                                             COUNTRY ID
     D QUSLID                         3
      *                                             LANGUAGE ID
     D QUSSLI                         1
      *                                             SUBSET LIST INDICATOR
     D QUSERVED00                    42
      *
     DQUSSPLKI         DS           100    BASED(LSTPTR2)
      *                                             QUS LSPL KEY INFO
     D QUSLFIR02                      9B 0
      *                                             LEN FIELD INFO RETD
     D QUSKFFFR00                     9B 0
      *                                             KEY FIELD FOR FIELD RETD
     D QUSTOD02                       1
      *                                             TYPE OF DATA
     D QUSR300                        3
      *                                             RESERV3
     D QUSDL02                        9B 0
      *                                             DATA LENGTH
      *                             VARYING LENGTH
     DQUSF0200         DS                  BASED(LSTPTR)
      *                                             QUS SPLF0200
     D QUSNBRFR00                     9B 0
      *                                             NUM FIELDS RETD
     D CLRPFM          DS
     D                               80    INZ('CLRPFM FILE(QTEMP/MOVOUTQP)')
      **********************************************************************************************
     D CMDLENGTH       S             15  5
     D CMDSTRING       S            256
     D EXT_ATTR        S             10
     D FORMAT          S              8
     D FORMTYPE        S             10
     D INDEX           S              3  0
     D JOBNAME         S             26
     D KEY#            S              9B 0 INZ(20)
     D LSTPTR          S               *
     D LSTPTR2         S               *
     D ONEPERCENT      S             11  2
     D OUTQUEUE        S             20
     D P#MBROPT        S              8
     D P#OUTQ          S             20
     D P#USER          S             10
     D SPC_AUT         S             10
     D SPC_DOMAIN      S             10
     D SPC_INIT        S              1    INZ(X'00')
     D SPC_NAME        S             20    INZ('USERSPLF  QTEMP     ')
     D SPC_REPLAC      S             10
     D SPC_SIZE        S              9B 0 INZ(2000)
     D SPC_TEXT        S             50
     D SPCPTR          S               *
     D SPLDATECHR      S              7
     D SPLTIMECHR      S              6
     D USER            S             10
     D USERDATA        S             10
     D X               S              9  0
      **********************************************************************************************
     C     *ENTRY        PLIST
     C                   PARM                    P#USER
     C                   PARM                    P#OUTQ
     C                   PARM                    P#MBROPT
      **********************************************************************************************
     C                   EXSR      #INITS
      *
     C                   EVAL      QUSBPRV = 0
      *
     C                   DO        20            INDEX
     C                   EVAL      KEYS(INDEX) = 200 + INDEX
     C                   ENDDO
      *
     C                   CALL      'QUSCRTUS'
     C                   PARM                    SPC_NAME
     C                   PARM      'QUSLSPL   '  EXT_ATTR
     C                   PARM                    SPC_SIZE
     C                   PARM                    SPC_INIT
     C                   PARM      '*ALL'        SPC_AUT
     C                   PARM      'WRKUSROUTQ'  SPC_TEXT
     C                   PARM      '*YES'        SPC_REPLAC
     C                   PARM                    QUSEC
     C                   PARM      '*USER'       SPC_DOMAIN
      *
     C                   CALL (E)  'QUSLSPL'
     C                   PARM                    SPC_NAME
     C                   PARM      'SPLF0200'    FORMAT
     C                   PARM      P#USER        USER
     C                   PARM      P#OUTQ        OUTQUEUE
     C                   PARM      '*ALL'        FORMTYPE
     C                   PARM      '*ALL'        USERDATA
     C                   PARM                    QUSEC
     C                   PARM                    JOBNAME
     C                   PARM                    KEYS
     C                   PARM                    KEY#
      *
     C                   IF        NOT %ERROR
     C                   CALL      'QUSPTRUS'
     C                   PARM                    SPC_NAME
     C                   PARM                    SPCPTR
     C                   PARM                    QUSEC
      *
     C                   IF        QUSSRL = '0100'
     C                   IF        QUSIS = 'C'
     C                             OR QUSIS = 'P'
      *
     C                   IF        QUSNBRLE > 0
      *
     C                   EVAL      LSTPTR = SPCPTR
     C                   EVAL      LSTPTR = %ADDR(ARR(QUSOLD + 1))
      *
     C                   DO        QUSNBRLE
      *
     C                   EVAL      X = 5
     C                   EVAL      LSTPTR2 = %ADDR(ARR(X))
     C                   DO        QUSNBRFR00
      *
     C                   SELECT
     C                   WHEN      QUSKFFFR00 = 201
     C                   EVAL      SPLNAME = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 202
     C                   EVAL      SPLJOBNAME = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 203
     C                   EVAL      SPLUSERPRF = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 204
     C                   EVAL      SPLJOBNBR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 205
     C                   EVAL      SPOOLNBRCHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   EVAL      SPLNBR = SPOOLNBR#
     C                   WHEN      QUSKFFFR00 = 206
     C                   EVAL      SPLOUTQ = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 207
     C                   EVAL      SPLOUTQLIB = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 208
     C                   EVAL      SPLDEVICE = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 209
     C                   EVAL      SPLUSRDTA = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 210
     C                   EVAL      SPLSTATUS = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 211
     C                   EVAL      TOTPAGESCHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   EVAL      SPLTOTPAGE = TOTPAGES#
     C                   WHEN      QUSKFFFR00 = 212
     C                   EVAL      CURPAGECHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   EVAL      SPLCURPAGE = CURPAGE#
     C                   WHEN      QUSKFFFR00 = 213
     C                   EVAL      COPIESLEFTCHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   EVAL      SPLCPYLEFT = COPIESLEFT#
     C                   WHEN      QUSKFFFR00 = 214
     C                   EVAL      SPLFORMTYP = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 215
     C                   EVAL      SPLPRIORTY = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 216
     C                   EVAL      SPLDATECHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   MOVE      SPLDATECHR    SPLDATE
     C                   WHEN      QUSKFFFR00 = 217
     C                   EVAL      SPLTIMECHR = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   MOVE      SPLTIMECHR    SPLTIME
     C                   WHEN      QUSKFFFR00 = 218
     C                   EVAL      SPLINJOBID = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 219
     C                   EVAL      SPLINSPLID = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   WHEN      QUSKFFFR00 = 220
     C                   EVAL      SPLDEVTYPE = %SUBST(QUSSPLKI:17:QUSDL02)
     C                   IF        SPLDEVTYPE = 'PRINTER'
     C                   EVAL      SPLDEVICE = SPLOUTQ
     C                   ENDIF
     C                   OTHER
     C                   EXSR      ERROR
     C                   ENDSL
      *
     C                   EVAL      X = X + QUSLFIR02
     C                   EVAL      LSTPTR2 = %ADDR(ARR(X))
     C                   ENDDO
     C                   WRITE     MOVOUTQR
      *
     C                   EVAL      LSTPTR = %ADDR(ARR(QUSSEE + 1))
     C                   ENDDO
     C                   ENDIF
     C                   ENDIF
     C                   ENDIF
   1 C                   ENDIF
      *
     C                   EVAL      *INLR = *ON
     C                   RETURN
      **********************************************************************************************
     C     #INITS        BEGSR
      *
     C                   IF        P#MBROPT = '*REPLACE'
     C                   CALL      'QCMDEXC'                            90
     C                   PARM      CLRPFM        CMDSTRING
     C                   PARM      80            CMDLENGTH
     C                   ENDIF
     C                   OPEN      MOVOUTQP
      *
     C                   ENDSR
      **********************************************************************************************
     C     ERROR         BEGSR
      *
     C     QUSKFFFR00    DSPLY
     C                   EVAL      *INLR = *ON
     C                   RETURN
      *
     C                   ENDSR


RPGLE:MOVOUTQR2
      *************************************************************************
     FMOVOUTQP  IF   E             DISK
      *************************************************************************
     D SDS#DS         SDS
     D  SDS#PGM                      10    OVERLAY(SDS#DS:1)
     D  SDS#USER                     10    OVERLAY(SDS#DS:254)

     D COMMAND1        DS
     D  CHGSPLFA                    120    INZ('CHGSPLFA FILE(1234567890) -
     D                                     JOB(123456/1234567890/1234567890) -
     D                                     SPLNBR(12345) -
     D                                     OUTQ(1234567890/1234567890)')
     D   CHGFILE                     10    OVERLAY(CHGSPLFA:15)
     D   CHGJOB                      28    OVERLAY(CHGSPLFA:31)
     D   CHGSPLNBR                    5  0 OVERLAY(CHGSPLFA:68)
     D   CHGOUTQ                     21    OVERLAY(CHGSPLFA:80)
      *************************************************************************
     D P#CMDSTRING     S            256
     D P#CMDLENGTH     S             15  5
     D P#QUALOUTQ      S             20
     D P#FILE          S             10
     D P#USRDTA        S             10
     D P#USER          S             10
     D P#STATUS        S              6
      *************************************************************************
     C     *ENTRY        PLIST
     C                   PARM                    P#QUALOUTQ
     C                   PARM                    P#FILE
     C                   PARM                    P#USRDTA
     C                   PARM                    P#USER
     C                   PARM                    P#STATUS
      *************************************************************************
     C                   EVAL      CHGOUTQ =
     C                             %TRIM(%SUBST(P#QUALOUTQ : 11 : 10)) + '/' +
     C                             %TRIM(%SUBST(P#QUALOUTQ : 1 : 10))
      *
     C                   IF        P#FILE > *BLANKS
     C                   IF        %SUBST(P#FILE : %LEN(%TRIM(P#FILE)) : 1) =
     C                             '*'
     C                   EVAL      %SUBST(P#FILE : %LEN(%TRIM(P#FILE)) : 1) =
     C                             ' '
     C                   ENDIF
     C                   ENDIF
      *
     C     1             SETLL     MOVOUTQP
     C                   READ      MOVOUTQP

     C                   DOW       NOT %EOF(MOVOUTQP)
      *
     C                   IF        (P#FILE = ' ' OR %TRIM(P#FILE) =
     C                             %SUBST(SPLNAME : 1 : %LEN(%TRIM(P#FILE))))
     C                             AND (P#USER = ' ' OR P#USER = SPLUSERPRF)
     C                             AND (P#USRDTA = ' ' OR P#USRDTA = SPLUSRDTA)
     C                             AND (P#STATUS = '*ALL' OR
     C                                  P#STATUS = SPLSTATUS)
     C                   EVAL      CHGFILE = SPLNAME
     C                   EVAL      CHGJOB = SPLJOBNBR + '/' +
     C                             %TRIM(SPLUSERPRF) + '/' +
     C                             %TRIM(SPLJOBNAME)
     C                   EVAL      CHGSPLNBR = SPLNBR
      *
     C                   CALL (E)  'QCMDEXC'
     C                   PARM      CHGSPLFA      P#CMDSTRING
     C                   PARM      120           P#CMDLENGTH
     C                   ENDIF
     C                   READ      MOVOUTQP
     C                   ENDDO

     C                   EVAL      *INLR = *ON
     C                   RETURN


PF:MOVOUTQP
     A          R MOVOUTQR
     A            SPLNAME       10A         TEXT('SPOOL FILE')
     A            SPLJOBNAME    10A         TEXT('JOB NAME')
     A            SPLUSERPRF    10A         TEXT('USER')
     A            SPLNBR         5S 0       TEXT('SPOOL NUMBER')
     A            SPLJOBNBR      6A         TEXT('JOB NUMBER')
     A            SPLOUTQ       10A         TEXT('*OUTQ')
     A            SPLOUTQLIB    10A         TEXT('*OUTQ LIBRARY')
     A            SPLDEVICE     10A         TEXT('DEVICE')
     A            SPLUSRDTA     10A         TEXT('USER DATA')
     A            SPLSTATUS     10A         TEXT('STATUS')
     A            SPLTOTPAGE     5S 0       TEXT('TOTAL PAGES')
     A            SPLCURPAGE     5S 0       TEXT('CURRENT PAGE')
     A            SPLCPYLEFT     5S 0       TEXT('COPIES LEFT')
     A            SPLFORMTYP    10A         TEXT('FORM TYPE')
     A            SPLPRIORTY     2A         TEXT('PRIORITY')
     A            SPLDATE        6S 0       TEXT('DATE')
     A            SPLTIME        6S 0       TEXT('TIME')
     A            SPLINJOBID    16A         TEXT('INTERNAL JOB IDENTIFIER')
     A            SPLINSPLID    16A         TEXT('INTERNAL SPOOL IDENTIFIER')
     A            SPLDEVTYPE    10A         TEXT('DEVICE TYPE')

タグ: SPOOL OUTQ

関連エントリー: -

最終更新: 2011-10-30 10:00
製作者:
改訂: 1.5

Digg it! Share on Facebook このレコードを印刷する 友達に教える PDF ファイルで表示する
Propose a translation for Propose a translation for
この FAQ を評価してください:

評価点数: 0 (0 件の投票)

完全に役に立たない 1 2 3 4 5 最も価値がある

このエントリーにコメントできません。