RFC 390 UNKNOWN REMOTE COMPUTING · TUTORIAL

TSO Scenario

A worked example of batch compilation and foreground execution in TSO.

On rfc-editor.org ↗
PUBLISHED
September 1972
AUTHORS
R.T. Braden
STREAM
Legacy
EXAMPLE PROGRAM
Fortran square root calculator
JOB NAME
ABC123P
COMPILATION RETURN CODE
0 (success)
DOI
10.17487/RFC0390

RFC text

Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                  Robert T. Braden
Request for Comments: 390                              UCLA/CCM
NIC: 11582                                             September 12, 1972

                              TSO SCENARIO
               BATCH COMPILATION AND FOREGROUND EXECUTION

logon uid                                              (Use your user-id)
LOGON UID                       (TSO repeats line for reasons of its own)
ENTER PASSWORD                                    (TSO asks for password)
xyz
UID LOGON IN PROGRESS AT 09:59:18 ON AUGUST 28, 1972
LOGON PROCEEDING                         (It may take a minute or longer)
WELCOME TO TSO.  GOOD LUCK.

= CCN NEWS =

THE DEFAULT LOGON PROCEDURE NO LONGER PRE-ALLOCATES FILES -
  SYSUT1, SYSUT2, AND SYSUT3.

READY                               (call EDIT to create source data set)
edit sample new fortg
INPUT          (for "new" data set, EDIT enters INPUT mode automatically)
00010 // exec fortgcl                                     (in INPUT mode,
00020 c  a sample fortran program            EDIT types out line numbers,
00030 c                                               user enters lines.)
00040 1     format(' enter a')
00050 2     format(' the square root of',f10.3,' is',f10.3)
00060 3     format(f10.3)
00070 100   write(6,1)                            (Specifying "fortg" in
00080       read(5,3) a                   edit command sets logical tabs
00090       b=sqrt(a)                             correctly for Fortran)
00100       write(6,2) a, b
00110       go to 100
00120       end
00130 /*
00140 //lked.syslmod dd disp=new,dsn=abc132.uid.load(root)
00150                                      (Null line leaves INPUT mode)
verify                    ("verify" causes changed line to be displayed)
change 140 /new/old/
00140 //LKED.SYSLMOD DD DISP=OLD,DSN=ABC123.UID.LOAD(ROOT)
list
00010 // EXEC FORTGCL
00020 C A SAMPLE FORTRAN PROGRAM
00030 C

00040 1     FORMAT(' ENTER A')
00050 2     FORMAT(' THE SQUARE ROOT OF',F10.3,' IS',F10.3)
00060 3     FORMAT(F10.3)
00070 100   WRITE(6,1)
00080       READ(5,3) A
00090       B=SQRT(A)
00100       WRITE(6,2) A, B
00110       GO TO 100
00120       END
00130 /*
00140 //LKED.SYSLMOD DD DISP=OLD,DSN=ABC132.UID.LOAD(ROOT)
END OF DATA
save                          (Make permanent copy of source file)
SAVED
end                           (Leave EDIT)
READY                         (Create new load module library data set)
allocate da(load) new space(5,5) block(7294) dir(1)
READY
free da(load)                 (Free library data set from TSO so batch
READY                         job can linkedit into it)
submit sample                 (Submit source file to batch)
ENTER JOBNAME CHARACTER-
p
JOB ABC123P SUBMITTED         (User "UID" has charge number "ABC123")
READY
status
 ABC123P  WAITING FOR READER
IEF404I ABC123P  ENDED        (Spontaneous message when job finishes)
READY
status
 ABC123P  FINISHED WAITING FOR WRITER
READY
keepout abc123p               (Save output in permanent data set)
SYSOUT DATA SET FOR JOB ABC123P ADDED TO PRINT DATA SET WITH UNLIKE ATTRIBUTES+
SYSOUT DATA SET FOR JOB ABC123P ADDED TO PRINT DATA SET WITH UNLIKE ATTRIBUTES+
NO CLASS OUTPUT FOR JOB ABC123P
EDIT OUTPUT.LIST  ("Keepout" leaves you in EDIT to examine output list)
find /return code/
CCN011I STEP RETURN CODE =     0
list
//ABC123P   JOB  'ABC123.UID,B=0672',
//             UID,
//             NOTIFY=UID,
//             MSGLEVEL=(1,1)
// EXEC FORTGCL                                                0000001

XXFORTGCL PROC TC=1439,TL=1439,PC=150,PL=10,RL=154K,RC=100K,LEVEL=1
XXFORT   EXEC  PGM=IEYFORT,REGION=&RC,TIME=&TC                 0000002
IEF653I SUBSTITUTION JCL - PGM=IEYFORT,REGION=100K,TIME=1439
XXSTEPLIB DD DISP=(SHR,PASS),DSN=&&FORTRAN&LEVEL               0000003
IEF653I SUBSTITUTION JCL - DISP=(SHR,PASS),DSN=&&FORTRAN1
XXSYSLIN DD DSN=&&LOADSET,DISP=(MOD,PASS),UNIT=SYSDA,          0000004
XX SPACE=(3200,(8,4),RLSE),DCB=BLKSIZE=3200                    0000005
XXSYSPRINT DD SYSOUT=A,DCB=(RECFM=FBA,LRECL=120,BLKSIZE=3480), 0000006
XX SPACE=(TRK,&PC,RLSE)                                        0000007
IEF653I SUBSTITUTION JCL - SPACE=(TRK,150,RLSE)
//SYSIN DD * GENERATED STATEMENT
IEF236I ALLOC. FOR ABC123P  FORT
IEF237I 342   ALLOCATED TO STEPLIB
IEF237I 450   ALLOCATED TO SYSLIN
IEF237I 630   ALLOCATED TO SYSPRINT
IEF237I 230   ALLOCATED TO SYSIN
1  FORTRAN IV G LEVEL  20                MAIN          DATE=72241

0               C  A SAMPLE FORTRAN PROGRAM
                C
    0001        1     FORMAT(' ENTER A')
    0002        2     FORMAT(' THE SQUARE ROOT OF',F10.3,' IS',F10.3)
    0003        3     FORMAT(F10.3)
    0004        100   WRITE(6,1)
    0005              READ(5,3) A
    0006              B=SQRT(A)
    0007              WRITE(6,2) A, B
    0008              GO TO 100
    0009              END
1 FORTRAN IV G LEVEL   20                MAIN          DATE=72241
0

SUBPROGRAMS CALLED
EDIT
end                           (Leave EDIT)
READY
print output.list             (Ask to have output printed at CCN)
DATASET OUTPUT.LIST HAS BEEN ENQUEUED FOR PRINTING IN CLASS C
READY                         (Now execute load module in foreground)
allocate file(ft05f001) da(*)
READY              (Allocate Fortran input and output files to terminal)
allocate file(ft06f001) da(*)
READY
call load(root)               (Call load module)
ENTER A
3.141
THE SQUARE ROOT OF      3.141 IS    1.772
ENTER A
4096.
THE SQUARE ROOT OF   4096.000 IS   64.000
ENTER A
READY
logoff
UID LOGGED OFF TSO AT 10:40:18 ON AUGUST 28,  1972+


       [ This RFC was put into machine readable form for entry ]
        [ into the online RFC archives by Marcus Meissner 1/98 ]

AI ELI5

On this page
PROBLEMResearchers needed to see how to use TSO's combined batch and foreground execution for real tasks.
MECHANISMRFC 390 walks through a complete scenario: logging on with a user ID and password, creating a Fortran source file with EDIT, submitting it to batch compilation, and running the compiled program interactively in the foreground.
A WORKED EXAMPLENetwork users could understand the full workflow of editing, compiling and running a Fortran program on UCLA CCN's TSO.

§1Login and File Creation

The scenario starts with logon using a TSO user ID and password. After the login sequence, the user enters the EDIT command to create a new Fortran source file named SAMPLE with a FORTG specification (which sets logical tabs correctly for Fortran). The EDIT command enters INPUT mode automatically for a new file, and the user types line numbers as prompts while entering lines. The example is a simple Fortran program that reads a number, computes its square root, and prints the result, with an infinite loop to accept multiple inputs.

The user logs in with a password, then uses the EDIT tool to type a Fortran program line by line.

§2Batch Submission and Execution

After editing and saving the source file, the user allocates a load module library dataset and then submits the source file to batch using the SUBMIT command. TSO prompts for a job name (P in this case), creates job ABC123P, and the user monitors the job's status through the STATUS command. The batch job runs the FORTGCL procedure to compile the Fortran code. Once the job finishes, the user examines the output using EDIT and a FIND command to locate the return code. BBN's system shows the compilation was successful (return code 0).

The user tells TSO to compile the program in the background. TSO gives it a job number and the user can ask how it is going. After a minute, the job finishes and the user can read the result.

§3Running the Program

With the compiled program ready, the user allocates input and output files to the terminal using ALLOCATE FILE commands, then uses the CALL command to run the compiled load module. The program prompts for input and the user enters two test values (3.141 and 4096), receiving the correct square root results. The user then types another value to re-enter the loop, and finally hits READY to exit the program, followed by LOGOFF to end the TSO session.

The user runs the compiled program right there at the terminal, types in some numbers, watches it calculate square roots, and logs off.

§4References