• Aucun résultat trouvé

At Your Terminal:

Dans le document VS FORTRAN (Page 124-128)

link Cmyprog,subprog) libC'vfortlib') loadCmyprog) print(*) When you specify PRINTC*), the linkage editor listings are displayed at your terminal.

EXECUTING YOUR PROGRAH--TSO

To execute your program, use the CALL command.

USING THE CALL COMMAND-" TSD LOAD MODULE EXECUTION

For example, to execute MYPROG.LOAD, you specify the ALLOCATE commands needed to allocate the input and output data sets it uses, as well as any work data sets.

Then you issue the CALL command, as follows:

allocate datasetCmyprog.indata) fileCF05FTOOl) (as needed) READY

allocate datasetCmyprog.outdata) fileCF06FTOOl) Cas needed) READY

allocate datasetCmyprog.workfil) fileCFlOFTOOl) (as needed) READY

call myprog

and program TEMPNAME from file MYPROG.LOAD is executed.

Onc~ program execution is complete, and if you n~ longer need them, you should issue the DELETE command to free the disk space 106 VS FORTRAN A~plic~tionProgramming: Guide

0,/

l

. ':~

(---"\ )

\~'

oj

C\

. '/

o

used by the data sets you've named in the ALLOCATE commands and in the CALL command:

delete (myprog.indata myprog.outdata myprog.workfil) READY

If you do need them, don't issue the DELETE co~mand; you can then reuse the data sets as necessary.

Using the Loader--TSO lOADGO Command

Using the LOADGO command, you can invoke the loader program to link-edit and execute your program all in one step. This is efficient when you have several object modules you want combined into one load module for a quick test. When you use the LOADGO command, the load module created is automaticallY deleted when program execution ends.

First, you must allocate any needed data sets, as outlined under.

"Allocating Compilation Data Sets-TSO ALLOCATE Command."

Then you issue the LOADGO command. In this example, you're linking and executing the MYPROG object module:

loadgo (myprog) lib('vfortlib')

The VFORTLIB operand makes the SYSl.FORTLIB data set available to the loader program. The loader program can then resolve any external references in MYPROG, and load the needed object modules.

You can also use the LOADGO command to execute a link-edited load module, for example, one named MYPROG:

loadgo myprog tempname '

You can also use the LOADGO command to specify loader options. In the last example, you can request a load module map and the

listings to be printed, either on the system printer or at your terminal:

On the Printer File:

loadgo (myprog) map print

The qualified name of the file sent to the system printer is MYPROG.LOADLIST.

At Your Terminal:

loadgo (myprog) map print(*)

When you specify PRINT(~), the loader listings are di~played at your termi nal.

FIXING EXECUTION ERRORS UNDER TSO

When you're developing programs using TSO, you can make use of all the FORTRAN debugging aids described in "Fixing

Execution-Time Errors-Advanced Programming."

You can't use the TEST command to debug your source programs.

However, you can use the TSO TEST command, together with its associated subcommands, to debug your ~bject program.

The easiest way to use 'TEST is to establish the point in your program where an abnormal termination occurred.

For best results; you should be familiar with the basic assembler language and addressing conventions.

Using OS/VS2-TSO with VS FORTRAN 107

Reference documentation on using the TEST command is givp.n in the VS FORTRAN Application Progra~m;ng: System Services Reference Supplement.

REQUESTING COMMAND PROCEDURE PROCESSING UNDE~

You can create a command procedure (CLIST) for a number of different processing options under TSO. This is useful, because you can preallocate all the options you need once, when you create the command procedure. Then, every time you execute the command procedure, there's no need to respecify the options.

You can create command procedures to process your jobs either in the foreground or in the background.

COMMAND PROCEDURES FOR FOREGROUND PROCESSING

To create a command procedure to link-edit and run a FORTRAN program in the foreground, do the following:

1. Edit a file named LINK.MYPROG.CLIST, which contains:

LINK MYPROG LIB('VFORTLIB') LOAD(MYPROGCMYNAME) TEST LIST LET XREF PRINT(MYPROG)

These options will allow you to use the TEST command (TEST), list the link-edit control statements (LIST), allow the procedure to complete execution even if there are errors (LET), produce a cross-reference table (XREF), and produce a linkage-editor listing on the MYPROG.LIST data set (PRINT).

2. Use the SAVE subcommand to save the command procedure.

3. To execute the link and run command procedure, enter:

ex link.myprog and press ENTER.

This tells TSO to create a load module, MYNAME, in file userid.MVPROG.LOAD

To run a prevously link-edited program, do the following:

1. Edit a file name RUH.MYPROG.CLIST which contains:

ALLOC FILE(FTxxFyyy) CALL MYPROG(MYNAME)

.

(work and data files as needed)

2. Use the SAVE subcommand to save the command procedure.

3. Use the END subcommand to exit from the EDIT command.

4. To execute the run command procedure, enter:

ex run.myprog and press ENTER.

This tells TSO to execute MYNAME in file userid.MYPROG.LOAD

~n the foreground.

COMMAND PROCEDURES FOR BACKGROUND EXECUTION

If your source programs are small, foreground execution ca~ be quite convenient. However, if your programs will take some time to compile and/or to execute, you may prefer to batch process 108 VS FORTRAN Application Programming: Guide

(~'\

}

\,--~/

them in the background. This frees your terminal for other work while the batch job is running.

To create a command procedure for background compilation, do the following:

1. Edit a file named COMPILE.MYPROG.CNTL, placing in it the

-following job control statements:

//userid JOB (acct. ;nformation),'yourname', other information //COMPILE EXEC VSFORTC

//VSFORT.SYSIN DD DSH=userid.MYPROG.FORT,DISP=SHR 2. Use the SAVE subcommand to save the command procedure.

3. To execute the run command procedure, enter:

submit compile.myprog and press ENTER.

This tells TSO to compile MYPROG in file userid.MYPROG.FORT in the background.

To create a command procedure for background compilation, link-editing, and execution, do the following:

1. Edit a file named RUN.MVPROG.CNTL, placing in it the following job control statements:

2.

3.

4.

//userid JOB (acct. information),'yourname', other information //RUN EXEC FORTCLG

//GO.FTnnFxxx DO OSN=userid.MYPROG.FORT, OISP=5HR

/*.

//GO.FTxxFyyy DO DSN=userid.MYPROG.DATA,

DISP=SHR (other files as needed) Use the SAVE subcommarid to save the command procedure.

Use the END subcommand to exit from the EDIT command.

To execute the compile-link-execute command procedure, enter:

submit run.myprog and press ENTER.

This tells T50 to compile, link-edit, and execute MYPROG in file userid.MYPROG.FORT in the background.

ISO FILE NAMING CONVENTIONS

When you're creating or processing files under TSO, you must use the TSO naming conventions, as follows:

[identification.lname.qualifier

[identification.]

name.

is the identification you supply in your LOGON command, or that you assign with the PROFILE command.

If you omit the· identification, your LOGON identification is assumed.

is the name you gi ve the fi Ie.

qualifier .

identifies the contents of the file. Qualifiers useful for FORTRAN are:

Using OS/VS2-TSO with VS FORTRAN 109

Dans le document VS FORTRAN (Page 124-128)