The NoteBook of EricKong

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

A load library contains programs ready to be executed.
一个加载库存里面包含着那些准备被调用的程序。

A load library can be any of the following:
加载库可以是下面几种类型
  • System library 系统库
  • Private library 私有库
  • Temporary library. 临时库

System library 系统库

Unless a job or step specifies a private library, the system searches for a program in the system libraries when you code:
假如你没有在编码的时候指明一个私有库, 系统默认在系统库里面寻找这个程序进行调用。
//stepname
EXEC PGM=program-name

The system looks in the libraries for a member with a name or alias that is the same as the specified program-name. The most-used system library is SYS1.LINKLIB, which contains executable programs that have been processed by the linkage editor.
系统会根据你提供的程序的名字或者是别名寻找所需要的程序,而最常用的系统库是SYS1.LINKLIB,他包含了那些已经被连接和编译的程序。

Private library 私有库

Each executable, user-written program is a member of a private library. To tell the system that a program is in a private library, the DD statement defining that library can be coded in one of the following ways:
每一个可执行,用户自己编写的程序都是私有库的一个成员,要告诉系统怎么调用这个私有库的程序,可以使用DD语句,方式有如下几种:
  • With a DD statement with the ddname JOBLIB after the JOB statement, and before the first EXEC statement in the job.
    在EXEC语句的之前,JOB语句之后,用DD语句加上ddname 来编码
  • If the library is going to be used in only one step, with a DD statement with the ddname STEPLIB in the step.
    假如这个库只在一个作业步中使用,那么可以使用在这个作业部上用 DD语句加上ddname STEPLI 进行编码
To execute a program from a private library, code: 调用一个私有库的程序,编码如下
//stepname  EXEC  PGM=program-name

When you code JOBLIB or STEPLIB, the system searches for the program to be executed in the library defined by the JOBLIB or STEPLIB DD statement before searching in the system libraries.
当你编写了JOBLIB 或者 STEPLIB,那么系统就会优先搜索那些定义在JOBLIB或者STEPLIB的DD语句的库的同名程序进行调用,假如找不到,系统就会在系统库里面去找

If an earlier DD statement in the job defines the program as a member of a private library, refer to that DD statement to execute the program:
假如用DD语句在JOB的之前的定义了一个私有库,那么就可以用下面的这种方式调用之前定义了的库的程序。

//stepname
EXEC PGM=*.stepname.ddname

Private libraries are particularly useful for programs used too seldom to be needed in a system library. For example, programs that prepare quarterly sales tax reports are good candidates for a private library.
私有库在实际使用上是非常有用的,而系统库是很少被使用,例如,用于季度销售税报告的程序就是一个很好的例子。

Temporary library 临时库

Temporary libraries are partitioned data sets created to store a program until it is used in a later step of the same job. A temporary library is created and deleted within a job.

临时库是一个用于存储程序的分区数据集,这个数据集直到同名作业完成后被销毁,一个临时库是由一个作业来创建或者被删除。

When testing a newly written program, a temporary library is particularly useful for storing the load module from the linkage editor until it is executed by a later job step. Because the module will not be needed by other jobs until it is fully tested, it should not be stored in a private library or a system library.

In Figure 1, the LKED step creates a temporary library called &&LOADMOD on the SYSLMOD DD statement. In the GO step, we refer back to the same temporary data set by coding:

当我们在测试一个新编写的程序的时候,临时数据集十分有用,它用于存储来自于连接编辑器的加载模块直至被后面的作业步执行,因为这个模块在其他作业被测试完成时候就不需要了,因此,它不应该被存为私有库或者是系统库,在下面的图1中吗,LKED作业步就创建了一个叫做&&LOADMOD的临时库在名为SYSLMOD的DD语句中,在GO作业步中,我们就引用了这个临时库,代码如下 
//GO EXEC PGM=*.LKED.SYSLMOD,....
Figure 1. Compile, link-edit, and execute JCL
//USUAL     JOB  A2317P,'COMPLGO'
//ASM       EXEC PGM=IEV90,REGION=256K,                   EXECUTES ASSEMBLER
//          PARM=(OBJECT,NODECK,'LINECOUNT=50')
//SYSPRINT  DD   SYSOUT=*,DCB=BLKSIZE=3509                PRINT THE ASSEMBLY LISTING
//SYSPUNCH  DD   SYSOUT=B                                 PUNCH THE ASSEMBLY LISTING
//SYSLIB    DD   DSNAME=SYS1.MACLIB,DISP=SHR THE MACRO LIBRARY
//SYSUT1    DD   DSNAME=&&SYSUT1,UNIT=SYSDA,              A WORK DATA SET
//          SPACE=(CYL,(10,1))
//SYSLIN    DD   DSNAME=&&OBJECT,UNIT=SYSDA,              THE OUTPUT OBJECT DECK
//          SPACE=(TRK,(10,2)),DCB=BLKSIZE=3120,DISP=(,PASS)
//SYSIN     DD    *                                       inline SOURCE CODE
                                           .
                                           .
                                           code
                                           .
/*
//LKED      EXEC PGM=HEWL,                                 EXECUTES LINKAGE EDITOR
//          PARM='XREF,LIST,LET',COND=(8,LE,ASM)
//SYSPRINT  DD   SYSOUT=*                                  LINKEDIT MAP PRINTOUT
//SYSLIN    DD   DSNAME=&&OBJECT,DISP=(OLD,DELETE)         INPUT OBJECT DECK
//SYSUT1    DD   DSNAME=&&SYSUT1,UNIT=SYSDA,               A WORK DATA SET
//          SPACE=(CYL,(10,1))
//SYSLMOD   DD   DSNAME=&&LOADMOD,UNIT=SYSDA,              THE OUTPUT LOAD MODULE
//          DISP=(MOD,PASS),SPACE=(1024,(50,20,1))
//GO        EXEC PGM=*.LKED.SYSLMOD,TIME=(,30),            EXECUTES THE PROGRAM
//          COND=((8,LE,ASM),(8,LE,LKED))
//SYSUDUMP  DD   SYSOUT=*                                  IF FAILS, DUMP LISTING
//SYSPRINT  DD   SYSOUT=*,                                 OUTPUT LISTING
//          DCB=(RECFM=FBA,LRECL=121)
//OUTPUT    DD   SYSOUT=A,                                 PROGRAM DATA OUTPUT
//          DCB=(LRECL=100,BLKSIZE=3000,RECFM=FBA)
//INPUT     DD    *                                        PROGRAM DATA INPUT
                 .
                 .
                 data
                 .
/*
//
posted on 2012-08-04 15:38 Eric_jiang 阅读(244) 评论(0)  编辑  收藏 所属分类: Mainframe

只有注册用户登录后才能发表评论。


网站导航: