OSI/TS Configuration and Management Manual

Programming Examples
OSI/TS Configuration and Management Manual424831-001
C-4
TAL Example File-Transfer Program, Responder
! *** Close the TSP requester SU
call close (osnum);
END;
TAL Example File-Transfer Program, Responder
Before running this program, your OSI/TS subsystem must be configured and running.
Before compiling the source code, you must first replace the file and process names with
names that reflect your environment, as described in the first comment box in the code.
The source code file for this example is provided as part of the OSI/TS software. It
resides (by default) in $SYSTEM.ZOSITS.EXPRGT1B.
! ******************************************************
! * File: EXPRGT1B
! *
! * TAL file transfer program example: Responder
! *
! 1) Replace "source" with the name of the file you
! want to transfer.
! 2) Replace "destin" with the name you want used to
! generate a file for the transferred copy.
! 3) Make sure that two TSP SUs are configured and
! replace $tsp1.#s00001 and $tsp2.#s00001 with
! the correct names.
! 4) Replace "vol" and "subvol" with the correct names.
! 5) Make sure the destination file size is large
! enough to accommodate the file to be transfered.
! This example is coded for a fairly large file, but
! if you need a larger buffer, change the code.
! 6) Compile and RUN.
!
! ******************************************************
!
?symbols, inspect
?nocode, nomap, nolmap
?DATAPAGES = 64
?page
! ****************************************************
! * DATA STRUCTURE DECLARATION
! ****************************************************
! 123456789012345678901234
INT .srcex^file^name[0:11] :="source "
INT .dsex^file^name[0:11] :="destin ";
INT .ext^dev^send[0:11] :="$tsp1.#s00001 ";
INT .ext^dev^rcv[0:11] :="$tsp2.#s00001 ";
INT .default^subvol[0:7] :="$vol subvol ";
INT .osi^dev^rcv[0:11] :=" ";
INT .osi^dev^send[0:11] :=" ";
INT .dest^file^name[0:11] :=" ";
INT .source^file^name[0:11] :=" ";
INT osnum,snum,ornum,dnum,count^read;
INT rec^len^send :=1024;
INT rec^len^rcv := 1024;