Using NS3000/iX Network Services (36920-90008)

Chapter 5 103
Network File Transfer
Programmatic NFT Examples
003000 PROCEDURE DIVISION.
003100 BEGIN.
003200 CALL "DSCOPY" USING OPT, SPEC, RESULT.
003300 IF RESULTS(1) > 0 CALL "DSCOPYMSG" USING RESULT, FNUM, R.}
003400 STOP RUN.
COBOL: Multiple Transfer
In this application, the opt parameter is set to one (1). DSCOPY
terminates after first failure. Primary output is disabled. The command
file spec for multiple transfers cannot be used. The spec parameter
contains a null character (numeric zero) indicating that transfer
requests are to be read from the DSCOPYI file. The “COPYFILE” must
already exist. You must issue the file equation “FILE
DSCOPYI=COPYFILE” prior to execution of the program.
001000$CONTROL USLINIT
001100 IDENTIFICATION DIVISION.
001200 PROGRAM-ID. MULTTRANSFER.
001300 REMARKS. THIS PROGRAM ACCEPTS INTERACTIVE TRANSFER REQUESTS;
001400 IT CALLS THE DSCOPY AND DSCOPYMSG INTRINSICS.
001500 ENVIRONMENT DIVISION.
001600 CONFIGURATION SECTION.
001700 SOURCE-COMPUTER. HP3000
001800 OBJECT-COMPUTER. HP3000
001900 DATA DIVISION.
002000 WORKING-STORAGE SECTION.
002100 01 OPT PIC S9(4) COMP VALUE 1.
002200 01 SPEC.
002300 02 TERMINATOR PIC S9(4) COMP VALUE 0.
002400 01 RESULT.
002500 02 RESULTS PIC S9(4) COMP OCCURS 2 TIMES.
002600 01 FNUM PIC S9(4) COMP VALUE 0.
002700 01 R PIC S9(4) COMP VALUE 0.
002800 PROCEDURE DIVISION.
002900 BEGIN.
003000 CALL "DSCOPY" USING OPT, SPEC, RESULT.
003100 IF RESULTS(1) > 0 CALL "DSCOPYMSG" USING RESULT, FNUM, R.
003200 STOP RUN.