Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1292755
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2011-08-15 09:46:10

****************************************************************

      *  Description.. Get and Put Spooled File API Example          *

      *  Program Name. SPLFAPI                                       *

      *  Author....... Bradley V. Stone                              *

      *                BVS/Tools -                   *

      ****************************************************************

     D SplfAtt         DS

     D  AtrData                1   3800

      *

     D APIError        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                 DS

     D Splf#b                  1      4B 0

     D CSpl#                   1      4

      *

     D SplSpc1         C                   CONST('SPL001US  QTEMP     ')

      *

     D SpcPtr          S               *

     D SpcDes          S             50    INZ('User Space Spool APIs')

     D SpcName         S             20

     D SpcAtr          S             10

     D SpcAut          S             10    INZ('*ALL')

     D SpcSiz          S              9B 0 INZ(32767)

     D SpcFormat       S              8

     D SpcInv          S              1

      *

     D JobName         S             26    INZ

     D JobID           S             26    INZ

     D SplFID          S             26    INZ

     D EndOper         S             10    INZ('*WAIT')

     D RecLen          S              9B 0 INZ(%size(SplfAtt))

     D SplfIH          S              9B 0

     D SplfOH          S              9B 0

     D #Buff           S              9B 0

     D Buffer#         S              9B 0

     D Splf#d          S              5  0

      *

     D File            S             10

     D Job             S             10

     D User            S             10

     D Job#            S              6

     D Splf#x          S              5

      ****************************************************************

     C                   EXSR      $ONE

      *

     C                   SETON                                        LR

      **************************************************************

      * Copy Spooled File To Duplicate Spooled File                *

      **************************************************************

     C     $ONE          BEGSR

      *

     C                   EXSR      $RTVSPLFA

     C                   eval      SpcName = SplSpc1

     C                   EXSR      $CRTSP

     C                   EXSR      $CREATESF

     C                   EXSR      $OPENSF

     C                   EXSR      $GETSF

     C                   EXSR      $PUTSF

     C                   EXSR      $CLOSESF

     C*                  EXSR      $DLTSP

      *

     C                   ENDSR

      **************************************************************

      * Create Spooled File                                        *

      **************************************************************

     C     $CREATESF     BEGSR

      *

     C                   CALL      'QSPCRTSP'

     C                   PARM                    SplfOH

     C                   PARM                    SplfAtt

     C                   PARM                    APIError

      *

     C                   ENDSR

      **************************************************************

      * Open Spooled File                                          *

      **************************************************************

     C     $OPENSF       BEGSR

      *

     C                   eval      #Buff = -1

      *

     C                   CALL      'QSPOPNSP'

     C                   PARM                    SplfIH

     C                   PARM                    JobName

     C                   PARM                    JobID

     C                   PARM                    SplfID

     C                   PARM                    File

     C                   PARM                    Splf#b

     C                   PARM                    #Buff

     C                   PARM                    APIError

      *

      *

     C                   ENDSR

      **************************************************************

      * Get Spooled File Data                                      *

      **************************************************************

     C     $GETSF        BEGSR

      *

     C                   eval      Buffer# = -1

      *

     C                   CALL      'QSPGETSP'

     C                   PARM                    SplfIH

     C                   PARM                    SpcName

     C                   PARM      'SPFR0200'    SpcFormat

     C                   PARM                    Buffer#

     C                   PARM                    EndOper

     C                   PARM                    APIError

      *

     C                   ENDSR

      **************************************************************

      * Put Spooled File Data                                      *

      **************************************************************

     C     $PUTSF        BEGSR

      *

     C                   CALL      'QSPPUTSP'

     C                   PARM                    SplfOH

     C                   PARM                    SpcName

     C                   PARM                    APIError

      *

     C                   ENDSR

      **************************************************************

      * Close Spooled File                                         *

      **************************************************************

     C     $CLOSESF      BEGSR

      *

     C                   CALL      'QSPCLOSP'

     C                   PARM                    SplfIH

     C                   PARM                    APIError

      *

     C                   CALL      'QSPCLOSP'

     C                   PARM                    SplfOH

     C                   PARM                    APIError

      *

     C                   ENDSR

      **************************************************************

      * Call Retrieve Spooled File Attributes API                  *

      **************************************************************

     C     $RTVSPLFA     BEGSR

      *

     C                   eval      JobName = Job + User + Job#

     C                   MOVE      Splf#x        Splf#d

     C                   eval      Splf#b = Splf#d

      *

     C                   CALL      'QUSRSPLA'

     C                   PARM                    SplfAtt

     C                   PARM                    RecLen

     C                   PARM      'SPLA0200'    SpcFormat

     C                   PARM                    JobName

     C                   PARM                    JobID

     C                   PARM                    SplfID

     C                   PARM                    File

     C                   PARM                    Splf#b

      *

     C                   ENDSR

      **************************************************************

      * Create User Space                                          *

      **************************************************************

     C     $CRTSP        BEGSR

      *

     C                   CALL      'QUSCRTUS'

     C                   PARM                    SpcName

     C                   PARM                    SpcAtr

     C                   PARM                    SpcSiz

     C                   PARM                    SpcInv

     C                   PARM                    SpcAut

     C                   PARM                    SpcDes

      *

     C                   ENDSR

      **************************************************************

      * Retrieve Pointer To User Space                             *

      **************************************************************

     C     $RTVSP        BEGSR

      *

     C                   CALL      'QUSPTRUS'

     C                   PARM                    SpcName

     C                   PARM                    SpcPtr

      *

     C                   ENDSR

      **************************************************************

      * Delete User Space                                          *

      **************************************************************

     C     $DLTSP        BEGSR

      *

     C                   CALL      'QUSDLTUS'

     C                   PARM                    SpcName

     C                   PARM                    APIError

      *

     C                   ENDSR

      ***************************************************************

      * INITIALIZATION SUBROUTINE                                   *

      ***************************************************************

     C     *INZSR        BEGSR

      *

     C     *ENTRY        PLIST

     C                   PARM                    File

     C                   PARM                    Job

     C                   PARM                    User

     C                   PARM                    Job#

     C                   PARM                    Splf#x

      *

     C                   ENDSR

 

阅读(1340) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~