The following programming example shows the downloading procedure for the TSO file, test.file.
C SAMPLE PROGRAM "sample fname" C THIS FORTRAN PROGRAM WILL DOWNLOAD THE TSO FILE test.file TO C THE AIX TEXT FILE /tmp/testfile. THE FILE WILL BE TRANSLATED C AND REPLACED ON THE OPERATING SYSTEM IF IT C ALREADY EXISTS. WE WILL BE INVOKING C THE FILE TRANSFER TO SESSION a. INTEGER FCFXFER EXTERNAL FCFXFER INTEGER FFXFER EXTERNAL FFXFER CHARACTER*60 SRC CHARACTER*60 DST CHARACTER*60 SRCF CHARACTER*60 DSTF CHARACTER*25 LOGID CHARACTER*20 COMM CHARACTER*60 TIME CHARACTER*64 INPUTFLD CHARACTER*16 AIXCODESET INTEGER BYTCNT,STAT,ERRNO INTEGER FLAGS,RECL,BLKSIZE,SPACE,INCR,UNIT,RC1,RC2 5 FORMAT ("--------------------------------------------") 6 FORMAT ("FXFER RETURN CODE =",1X, I4) 7 FORMAT ("CFXER RETURN CODE =",1X, I4) 8 FORMAT ("SOURCE FILE =",1X, A) 9 FORMAT ("DESTINATION FILE =",1X, A) 10 FORMAT ("BYTE COUNT =",1X, I10) 11 FORMAT ("TIME =",1X, A) 12 FORMAT ("STAT =",1X, I10) 13 FORMAT ("ERRNO =",1X, I10) DSTF = '/tmp/testfile'//CHAR(0) SRCF = 'test.file'//CHAR(0) LOGID = CHAR(0) INPUTFLD = CHAR(0) AIXCODESET = CHAR(0) SRC = CHAR(0) DST = CHAR(0) RECL = 0 BLKSIZE = 0 SPACE = 0 C THESE FLAGS REPRESENT TSO(1024) + REPLACE(16) + TRANSLATE(4) C + DOWNLOAD(2) FLAGS = 1046 C WE WANT TO RUN THE FILE TRANSFER TO SESSION a. COMM = 'a'//CHAR(0) RC1 = FFXFER(SRCF,DSTF,LOGID,FLAGS,RECL,BLKSIZE,SPACE, + INCR,UNIT,INPUTFLD,AIXCODESET,COMM) WRITE(6,6) RC1 RC2 = FCFXFER(SRC,DST,BYTCNT,STAT,ERRNO,TIME) WRITE(6,7) RC2 WRITE(6,5) WRITE(6,8) SRC WRITE(6,9) DST WRITE(6,10) BYTCNT WRITE(6,11) TIME WRITE(6,12) STAT WRITE(6,13) ERRNO WRITE(6,5) 22 STOP 23 END