SET SOURCE command

Associates a source file, compiler listing or separate debug file with one or more compile units and specifies whether the source file or listing is displayed when the compile unit is active.

Read syntax diagramSkip visual syntax diagramSETSOURCEONOFF(,cu_spec)fileid;
ON
Displays the source or listing for a compile unit when the compile unit is active.
OFF
Specifies that the file is not displayed.
cu_spec
A valid compile unit specification. Multiple compile units can be associated with the same source, listing or separate debug file.
fileid
Identifies the source, listing or separate debug file to be used for the compile unit. The file that you specify must be of fixed block format. You cannot specify concatenated data sets.

In z/OS®, fileid is a DD name, a fully qualified partitioned data set and member name, a sequential file, or an HFS or zFS path and file name.

In CICS®, fileid is a fully-qualified data set name or an HFS or zFS path and file name.

If fileid is less than nine characters in length and does not contain a period, z/OS Debugger assumes it is a DD name. z/OS Debugger checks to see if it is allocated. If it is not allocated, then fileid is assumed to be a data set name.

Fileid specifies a file identifier used in place of the default file identifier for the compile unit. A valid fileid is required unless it is already known to z/OS Debugger (by using a previous SET SOURCE command) or the default fileid is valid.

Fileid cannot be a DD name if the data set allocated to it is C, C++ or Enterprise PL/I source and you specify the EQAOPTS SUBSYS command to enable access to the source file in a library system.

Usage notes

  • This command is not supported for the Enterprise COBOL for z/OS Version 5 compiler.
  • If you compiled your C or C++ program with the FORMAT(DWARF) suboption of the DEBUG compiler option, you cannot use the SET SOURCE command to specify the new location of the .dbg or .mdbg file.
  • When SET SOURCE is issued for the currently executing compile unit, a test is performed for the existence of the file. If the compile unit is not the current compile unit, this test is not performed until the compile unit becomes current. The file associated with the source might not exist and the error message for the nonexistent file does not appear until a function that requires this file is attempted.
  • When you specify a cu_spec that identifies a compile unit that is not currently known to z/OS Debugger, z/OS Debugger looks for a deferred LOADDEBUGDATA command with the specific cu_spec. If z/OS Debugger finds such a deferred LOADDEBUGDATA command, z/OS Debugger associates the fileid with the deferred LOADDEBUGDATA command. When the compile unit appears and is activated, z/OS Debugger loads the EQALANGX data from the specified file.
  • The SET SOURCE ON command has a higher precedence than the SET DEFAULT LISTINGS command.
  • For COBOL, if the cu_spec includes any names that are case sensitive, enclose the name in quotation marks (") or apostrophes (').
  • The SET SOURCE command has no effect on a disassembly compile unit. However, it is saved and might apply later if the compile unit is specified as the operand of the LOADDEBUGDATA command.
  • If the file name does not fit on one line, suffix it with a trailing hyphen.

Examples

  • Indicate that the COBOL listing associated with compile unit prog1 is found in DD name mainprog. In a TSO session, allocate the listing data set:
    ALLOCATE FI(MAINPROG) DA('USERIBM.COBOL.LISTING(PROG1)') SHR
    Start z/OS Debugger and issue:
    SET SOURCE ON (prog1) mainprog;
    When prog1 is made current during the debug session, z/OS Debugger searches for the listing in USERIBM.COBOL.LISTING(PROG1).
  • Indicate that the COBOL listing associated with compile unit prog1 is found in DD name mainprog. In a TSO session:
    SET SOURCE ON (prog1) USERIBM.COBOL.LISTING(PROG1)
    This accomplishes the same result as the previous example without the execution of the ALLOCATE command.
  • Indicate that the source associated with compile unit "⁄u⁄userid⁄code⁄oefun.c" is found in the HFS or zFS under the path and file name "⁄u⁄userid⁄code⁄oefun.c".
    SET SOURCE ON ("⁄u⁄userid⁄code⁄oefun.c") ⁄u⁄userid⁄code⁄oefun.c;
  • Indicate that the PL/I listing file associated with compile unit AVER is found in MYID.PLI.LISTING(AVER)
    SET SOURCE ON (AVER) myid.pli.listing(AVER) ;
  • Indicate that the C source associated with compile unit USERIBM.C.SOURCE(myprog) is found in the PDS and member CODE.CLIB.SOURCE(myprog).
    SET SOURCE ON ("USERIBM.C.SOURCE(myprog)") CODE.CLIB.SOURCE(myprog)
  • Enter the SET LONGCUNAME OFF command to indicate that you want to use short CU names, then indicate that the C source associated with compile unit USERIBM.C.SOURCE(myprog) is found in the PDS and member CODE.CLIB.SOURCE(myprog):
    SET LONGCUNAME OFF;
    SET SOURCE ON (myprog) CODE.CLIB.SOURCE(myprog)
  • A PL/I program is compiled with a version of the Enterprise PL/I compiler that is earlier than Enterprise PL/I for z/OS, Version 3.5 with the PTFs for APARs PK35230 and PK35489 applied. Indicate that the PL/I source associated with compile unit USERIBM.PLI.SOURCE(myprog) is found in the PDS and member CODE.PLILIB.SOURCE(myprog):
    SET LONGCUNAME OFF;
    SET SOURCE ON (myprog) CODE.PLILIB.SOURCE(myprog)
  • A PL/I program is compiled with one of the following compilers and it is running in the following environment:
    • Enterprise PL/I for z/OS, Version 3.6 or later
    • Enterprise PL/I for z/OS, Version 3.5, compiler with the PTFs for APARs PK35230 and PK35489 applied
    Indicate that the PL/I source associated with compile unit USERIBM.PLI.SOURCE(myprog) is found in the PDS and member CODE.PLILIB.SOURCE(myprog):
    SET SOURCE ON (myprog) CODE.PLILIB.SOURCE(myprog)

Refer to the following topics for more information related to the material discussed in this topic.