• Aucun résultat trouvé

INCLUDE FUN;

Dans le document OS PL/I Optimizing Compiler: (Page 86-90)

CHAPTER 2. THE COMPILER

Y. INCLUDE FUN;

TEST: PROC OPTIONS(MAIN)j DCL NAME CHAR(10),

NO FIXED DEC(7);

ON ENDFIlECSYSIN) GO TO FINISH;

AGAIN: GET FILECSYSIN) EDITCNAME) (COLUMNC1),ACIO»j NO=SUBFUNCNAME);

PUT FILECSYSPRINT) SKIP EDITC'FOUND',NAME,NO) (A(6),A(lO),FC7»;

GO TO AGAIN;

Y.INCLUDE FUN;

FINISH: END TESTj

//GO.IN DD DSN=HPU8.NEWLIBCIN),DISP=COLD,KEEP),UNIT=SYSDA, // VOL=SER=nnnnnn,DCB=(RECFM=FB,lRECL=80,BlKSIZE=400) //GO.SYSIN DD

*

LOS ANGLES SACRAMENTO COLUMBUS

/*

Figure 17. Including Source Statements from a Library

The Y.INCLUDE statement may include one or more pairs of

identifiers. Each pair of identifiers specifies the name of a DD statement that defines a library and, in parentheses, the name of a member of the library, For example, the statement.

Y.INClUDE DDI (INVERT),DD2(lOOPX);

specifies that the source statements in member INVERT of the library defined by the DD statement with the name DOl, and those in member lOOPX of the library defined by the DO statement with the name DD2, are to be inserted consecutivelY into the source program. The compilation job step must include appropriate DD statements.

If you omit the ddname from any pair of identifiers in a

y.INClUOE statement, the ddname SYSlIB will be assumed. In such a case, you must include a OD statement with the name SYSlIB.

(The IBM-supplied cataloged procedures do not include a DD statement with this name in the compilation procedure step.) A PROCESS statement in source text included by a Y.INClUDE statement will result in an error in the compilation.

The use of a Y.INCLUDE statement to include the source statements for SUB FUN in the procedure TEST is shown in Figure 17 on

page 61. The library HPU8.NEWlIB is defined in the DD statement with the qualified name PLI.SYSLIB, which is added to the

statements of the cataloged procedure PLIXCl for this job.

Since the source statement library is defined by a DD statement with the name SYSLIB, the Y.INClUDE statement need not include a ddname.

It is not necessary to invoke the preprocessor if your source program, and any text to be included, contains no preprocessor statements other than Y.INClUDE. Under these circumstances, faster inclusion of text can be obtained by specifying the INCLUDE compiler option.

DYNAMIC INVOCATION OF THE COMPILER

You can invoke the optimizing compiler from an Assembler

language program by using one of the macro instructions ATTACH, CAll, lINK, or XCTl. The following information supplements the description of these macro instructions given in the supervisor and data management manual.

To invoke the compiler specify IElOAA as the entry point name.

You can pass three address parameters to the compiler:

1. The address of a compiler option list.

2. The address of a list of ddnames for the data sets used by the compiler.

3. The address of a page number that is to be used for the first page of the compiler listing on SYSPRINT. • These addresses must be in adjacent fullwords, aligned on a fullword boundary. Register 1 must point to the first address in the list, and the first Cleft-hand) bit of the last address must be set to 1, to indicate the end of the list.

Note: If you want to pass parameters in an XCTl macro instruction, you must use the execute (E) form of the macro instruction. Remember also that the XCTl macro instruction indicates to the control program that the load module containing the XCTl macro instruction is completed. Thus the parameters must be established in a portion of main storage outside the load module containing the XCTl macro instruction, in case the load module is deleted before the compiler can use the

parameters.

62 OS Pl/I Optimizing Compiler: Programmer's Guide

OPTION LIST

DDNAME LIST

The format of the three parameters for all the macro instructions is described below.

The option list must begin on a halfword boundary, The first two bytes contain a binary count of the number of bytes in the list (excluding the count field). The remainder of the list can comprise any of the compiler option keywords, separated by one or more blanks, a comma, or both of these.

The ddname list must begin on a halfword boundary. The first two bytes contain a binary count of the number of bytes in the list (excluding the count field). Each entry in the list must occupy an 8-byte field; the sequence of entries is given in Figure 18.

Entry 1 2 3 4 5 6 7 8

9

10 11 12 13 14

Figure 18.

standard ddname SYSLIN

not applicable not applicable SYSLIB

SYSIN SYSPRINT SYSPUNCH SYSUTl

not applicable not applicable not applicable not applicable not applicable SYSCIN

The Sequence of Entries in the DDname List

If a ddname is shorter than 8 bytes, fill the field with blanks on the right. If you omit an entry, fill its field with binary zeros; however, you may omit entries at the end of the list entirely.

PAGE NUMBER

The page number is contained in a 6-byte field beginning on a halfword boundary. The first halfword must contain the binary value 4 (the length of the remainder of the field). The last four bytes contain the page number in binary form.

The compiler will add 1 to the last page number used in the compiler listing and put this value in the page-number field before returning control to the invoking routine. Thus, if the compiler is reinvoked, page numbering will be continuous.

USING FAST PATH INITIALIZATION/TERMINATION (PL/I RELEASE 4)

The fast path initialization/termination feature reduces the time taken for initialization and termination of a Pl/I program at the expense of a slight additional storage overhead in the load module. It is intended for installations where a large number of small programs are in use, such as IMS or other

transaction oriented systems. (It is not intended for use with eIeS where initialization and termination is handled in a

different way; see Chapter 15 .. "Using Pl/I on eIeS" on page 360 for information on CICS.)

The feature can be installed during installation of the compiler and libraries. If it is installed, it applies to all programs.

Your system programmer will tell you whether fast path

initialization/termination is installed in your installation.

If the feature is installed, the following points should be borne in mind to make the best use of it:

• Execution time options should either be specified in the PlIXOPT string or be taken from installation defaults. Do not pass them as parameters.

• ISASIZE should be specified as a positive figure large enough to hold at least the initial storage requirements of the first block.

• NOSTAE and NOSPIE should be specified. (Using NOSTAE gives greater savings than using NOSPIE but both should be used where possible.)

• ON FINISH on-units should not be used.

An example of a suitable PlIXOPT string might bel

~L PlIXOPT CHARCSO) VAR EXTERNAL INIT ('NOSTAE NOSPIE ISASIZE(SOOO)');

The REPORT option will help you to determine the ISA size that you need. To determine the minimum figure you should specify an ISASIZE of 1 and run with the REPORT option. The figure given in report output for "Length of Initial Storage Area" will then give you the minimum requirements for fast initialization. This will not, however, necessarily give the optimum performance;

(see "Execution-Time Options" on page 31 for a full discussion on ISASIZE.)

In most installations using fast path

initialization/termination, ISA size will not be critical as the Pl/I programs will be small, and there will probably be enough space to make the installation default ISA size large enough to

handle most programs.

64 OS Pl/I Optimizing Compiler: Programmer's Guide

Dans le document OS PL/I Optimizing Compiler: (Page 86-90)