z/OS TSO/E Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Preparing to Use TEST

z/OS TSO/E Programming Guide
SA32-0981-00

To test your program, it must be in object module or load module form. Therefore, you must first perform an assembly or an assembly and link-edit on your program. You can do this with a batch job, or by issuing TSO/E commands in the foreground. This tutorial uses foreground commands.
(1) READY

(2) asm sample1 test

(3) ASSEMBLER (XF) DONE
    NO STATEMENTS FLAGGED IN THIS ASSEMBLY
    HIGHEST SEVERITY WAS    0
    OPTIONS FOR THIS ASSEMBLY
     ALIGN, ALOGIC, BUFSIZE(STD), NODECK, NOESD, FLAG(0), LINECOUNT(55),
     NOLIST, NOMCALL, YFLAG, WORKSIZE(2097152),
     NOMLOGIC, NUMBER, OBJECT, NORENT, NORLD, STMT, NOLIBMAC,
     TERMINAL, TEST, NOXREF(SHORT)
     SYSPARM()
    READY

(4) link sample1 test

    READY
  1. After your data set is created, place yourself at READY mode of TSO/E.
  2. The command to assemble a program is ASM:
    • ASM requires, as the first operand, the name of the data set that contains the program to be assembled.

      In this example, all you specify is SAMPLE1, because TSO/E naming conventions places your prefix (usually your user ID) to the left of the name you enter, and the type ASM to the right, yielding the fully-qualified name ‘prefix.SAMPLE1.ASM’.

    • The ASM command assembles your program and produces an output object module. This will be placed in the data set ‘prefix.SAMPLE1.OBJ’, which will be created automatically if it does not exist.
    • You can specify assembler options after the data set name. The example requests the TEST option, which allows you to access internal symbols in your program. You will see the effect of this under the TEST command.
  3. After the assembly is done, you should receive the final diagnostics, NO STATEMENTS FLAGGED.

    If you have assembly errors, correct your source code and reassemble until you have no errors.

  4. After the program is assembled, use the LINK command to link-edit it.
    • As its first operand, the LINK command requires the name of the data set containing the object module to be link-edited.

      Again, the name SAMPLE1 suffices because TSO/E naming conventions places your prefix on the left, and the type OBJ on the right, yielding ‘prefix.SAMPLE1.OBJ’.

    • Similar to ASM, you can specify link-edit options on the command. TEST is the option specified, and it continues to allow you to access internal symbols.
    • The output of the LINK command is a load member of a partitioned data set (PDS). The default data set is ‘prefix.SAMPLE1.LOAD(TEMPNAME)’, which is automatically created if it does not exist.
    Now that your program is in load module form, you can execute it using the TEST command.
    (5) test sample1
    (6)  TEST
    
    (7) go
    (8)  IKJ57023I PROGRAM UNDER TEST HAS TERMINATED NORMALLY+
    (9)  TEST
    
    (10) help
    
    SUBCOMMANDS -
      ASSIGN,AND,AT,CALL,COPY,DELETE,DROP,END,EQUATE,FREEMAIN,GETMAIN,GO,
      LIST,LISTDCB,LISTDEB,LISTMAP,LISTPSW,LISTTCB,LISTVSR,LOAD,OFF,OR,
      QUALIFY,RUN,WHERE.
    IKJ56804I FOR MORE INFORMATION ENTER HELP SUBCOMMANDNAME OR HELP HELP
    TEST
    
    (11) end
    (12)  READY
  5. The TEST command requires just the name of the program to test.

    Again, you need only specify SAMPLE1, because TSO/E supplies the prefix on the left and the TEST command assumes the type LOAD. Also, the default member name is TEMPNAME, yielding the data set ‘prefix.SAMPLE1.LOAD(TEMPNAME)’.

  6. TEST displays a TEST mode message, indicating that it is your turn to enter TEST subcommands to control TEST's processing.

    Right now, your program has been loaded into storage, but has not yet started execution.

  7. Run your program with the GO subcommand.

    This subcommand tells TEST to start executing the program wherever it left off (in this case, at the start of the program), and continue until the program stops.

  8. The program runs to normal completion, meaning there was no abend.
  9. TEST returns control to the terminal with another mode message.

    Now that the program has executed, you may wish to use other TEST subcommands to view and alter the program.

  10. The HELP subcommand provides a list of the TEST subcommands.

    HELP also describes the function, syntax, and operands of the the TEST command (not shown).

  11. To terminate TEST processing, use the END subcommand.
  12. TEST returns to READY mode.

So far, you have seen how to get a program ready for TEST using foreground assembly and link-edit, how to invoke TEST, run the program, and terminate the TEST session.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014