ALIAS Statement



The ALIAS statement allows alternative names to be associated with programs in either a Partitioned Data Set (PDS) or Partitioned Data Set Extended (PDSE).

These names may represent alternative entry points to the main program, but that will depend on whether there are matching entries in the External Symbol Dictionary (ESD), which in turn will depend upon the presence pf an ENTRY statement within the program source, or a matching Control Section (CSECT) name. (The latter is more relevant to Assembler.) The next two pages show Assembler and Cobol examples.




//L        EXEC PGM=HEWL,
//             PARM='MAP,LET,LIST,NCAL',
//             COND=(8,LT,C)
//SYSLIN   DD  DSN=&&OBJ,DISP=(OLD,DELETE)
//         DD  DDNAME=SYSIN
//SYSLMOD  DD  DISP=SHR,DSN=real.livbrary
//*SYSLMOD  DD  DISP=SHR,DSN=real.library(progname)
//SYSUT1   DD  DSN=&&SYSUT1,
//            SPACE-(1024,(120,120),,,ROUND),
//            UNIT=VIO,DCB=BUFNO=1
//SYSPRINT DD  SYSOUT=*
//MYLIB    DD  DISP=SHR,DSN=program.libarary
//SYSIN    DD  *
  ALIAS ep_name
  NAME    progname


The ep_name must comply with program naming rules. If there is no matching ESD entry, the alias becomes an alternative name to that on the NAME statement and processing will start at the main entry point.

Copyright © Legac-e Education 2015-