12.07.2015 Views

SDISC Assembler Call - NetEx

SDISC Assembler Call - NetEx

SDISC Assembler Call - NetEx

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FORTRAN Requestor Program ExampleFollowing is an example of a remote file access program. This program prompts the user for a record number,calls NETEX to obtain the information in the remote file, and displays a portion of the contents of therecord on the user's terminal.C **********************************************************************CC Remote File Access ProgramCC This program is designed to display records in the remoteC file controlled by a direct access file service program.C The program prompts the user for the record number neededC in the remote file, calls NETEX to obtain the informationC in the remote file, and displays a portion of the contentsC on the user's terminal.CC **********************************************************************CC FNRB is the 40 words needed for a NETEX request block.CINTEGER FNRB(40)CC NXDATA is the buffer of data exchanged with the remoteC program. NXDATA(1) contains the request type;C NXDATA(2) contains the record number, and the remainderC contains the 1K bytes of file information on return.CINTEGER NXDATA(258)DATA (FNRB(I),I=1,40) /40*0/CC Connect to the program. A password must be provided inC the first two words. The remote program is assumed toC reside on host `XYZ'. If connect fails for any reason, exit.CNXDATA(1) = 1234567NXDATA(2) = 7654321CALL SCONNW (FNRB,NXDATA,2,0,’SERVER ‘,LOOPBAK ‘)IF (FNRB(1).NE.0) GOTO 900CC Read connect confirmation. If other than a confirmationC is received, disconnect and exit. If confirm is not receivedC within 30 seconds, exit.CCALL SREADW (FNRB,NXOATA,256,30)IF (FNRBC1).NE.0) GOTO 800IF (FNRB(2).NE.2) GOTO 809CC Process queryC100 WRITE (6,110)110 FORMAT (‘ Enter record number as S digits:’)READ (6,120) IRECIF (IREC .EQ. 0) GOTO 806Page 62 FORTRAN Interface MAN-REF-H307IP-04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!