Sample 3780 BSC Command File for the purpose of:  Placing a PC into a WAIT state and waiting for an incoming file.  The incoming file is received as INCOMING.xxx.  After it is received a copy is made to c:\3780\data\upload.txt and also c:\3780\data\yymmddhh.mms.  The upload.txt file is upload to the mainframe via FTP and then erased.  The second copy with the name based on the date/time is made for backup.  Developed by:

Eric Schadow
Systems Programmer
Davis Vision
mailto:eschadow@davisvision.com
http://www.davisvision.com
Phone 518-386-6195
Fax 518-370-0014

Batch STARTRJE.BAT file (calls CMD file):

:TOP
rem
rem start fastsync s/w
rem when it completes a transfer a copy of the file is called
rem c:\3780\data\upload.txt
rem
FASTSYNC .AUTOSYNC1 .CMD(STARTRJE.CMD)
rem
rem check that the file to be ftp exists
rem if it does it calls the uplodftp.bat file
rem if not it loops to start of bat file
rem
IF NOT EXIST C:\3780\DATA\UPLOAD.TXT GOTO TOP
rem
rem call ftp upload bat file
rem
CALL C:\3780\UPLODFTP.BAT
rem
rem erase upload.bat file so it is not sent again.
rem
ERASE C:\3780\DATA\UPLOAD.TXT
rem
GOTO TOP

-------------------------------------------------

uplodftp.bat file (Windows/95)

rem start ftp passing it the parm file rje.ftp
ftp -s:rje.ftp

-------------------------------------------------
rje.ftp  contents ( Windows/95) below. Signs on to VSE/ESA FTP server and ftps file to POWER RDR queue. 

open 10.1.50.2
anonymous
user@host.com
cd power
cd rdr
cd a                
quote site crlf on
quote site recfm fb
quote site blksize 80  
quote site lrecl 80 
put c:\3780\data\upload.txt
quit


FastSync 3780 Command (STARTRJE.CMD) File shown below:

!
! Wait 10 seconds
!
10.DTR, OFF
.DELAY,30
.DTR,ON
!
! Wait for call
!
11.WAIT
!
! RECEIVE file as INCOMING.xxx info c:\3780 directory
!
.RCVE,INCOMING
!
! After file is received a copy will be made as C:\3780\DATA\UPLOAD.TXT
! and also C:\3780\DATA\YYMMDDHH.MMS  for historical purposes.
! UPLOAD.TXT file is the file to be uploaded to Mainframe

! Setup $FILE as the value of last_file
!
.SET,$FILE = @LAST_FILE
!
! Echo to Screen for debugging
!
.ECHO,LASTFILE: @LAST_FILE
.ECHO,FILE: @$FILE
!
! Erase current UPLOAD.TXT file
!
.ERASE C:\3780\DATA\UPLOAD.TXT
!
! Build output historical dataset name based on yymmddhh.mms to make
! a unique file name

.SET,$TEMP = @DATE
.ECHO,@$TEMP
.SET,$MONTH = @$TEMP (0:1)
.SET,$DAY = @$TEMP (3:4)
.SET,$YEAR = @$TEMP (6:7)
.SET,$TEMP = @TIME
.SET,$HOUR = @$TEMP (0:1)
.SET,$MIN = @$TEMP (3:4)
.SET,$SEC = @$TEMP (6:6)
!
! set $RJFILE as historical dataset name
!
.SET,$RJFILE = C:\3780\DATA\@$YEAR@$MONTH@$DAY@$HOUR.@$MIN@$SEC
!
! Echo to screen for debugging
!
.ECHO,@$RJFILE
!
! Copy file just received to C:\3780\DATA\UPLOAD.TXT
! based in yymmddhh.mms format.
!
.DOS,COPY @$FILE @$RJFILE
!
! Copy file just received to UPLOAD.TXT for upload to mainframe
!
.DOS,COPY @$FILE C:\3780\DATA\UPLOAD.TXT
!
! Wait For DOS copy commands to finish
!
.DELAY,5
!
! Start batch file on Windows/95 to use ftp to move file to Mainframe.
!
! DOS,C:\3780\UPLODFTP.BAT
!
! WAIT 90 seconds for macro to complete and goto step 10  and wait for next file
!
.DELAY,90
! .GOTO 10
.EXIT
More from CTI...
 3780 Mini-Overview
 SyncPack2000e®
 Testimonials