home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / g / getquo30.zip / MAKE_SCR.LST < prev    next >
File List  |  1993-01-09  |  10KB  |  262 lines

  1. ***** UTAH Fortran 1.0 (Mod 4) ** Compiling File: C:MAKE_SCR.FOR *****
  2.  
  3. 0001 OPTIONS X
  4.      C  C:\AUTOSIG\MAKE_SCR.FOR
  5.      C
  6.      C  This UTAH FORTRAN program creates an .SCR file for AUTOSIG to
  7.      C  access BASICQUOTES.  It assumes the default directory is C:\AUTOSIG
  8.      C  and all files are located there unless a configuration control file
  9.      C  exists.
  10.      C
  11.      C  Inputs:
  12.      C     TICKER.LST   - List of stock symbols in Fortran A6 format.
  13.      C     PROGRAM.CTL  - Configuration control file containing drives, paths,
  14.      C                    and PROGRAM file name if not C:\AUTOSIG\AUTOSIG.EXE
  15.      C
  16.      C  Outputs:
  17.      C     ATOSTART.BAT - Batch file for automatic operation.
  18.      C     DYyymmdd.LOG - Session log of the quotes recieved.
  19.      C     DYyymmdd.SCR - SCR file envoked by ATOSTART when AUTOSIG is started.
  20.      C       where   yy - Year
  21.      C               mm - Month
  22.      C               dd - Day
  23.      C
  24.      C  Rev. 0    Clinton D. Huntemann    -   April 27, 1992
  25.      C            (71247,2065)
  26.      C            5 Longwood Avenue
  27.      C            Londonderry, New Hampshire 03053
  28.      C            phone (603) 432-7554
  29.      C
  30.      C  Rev. 1    Clinton D. Huntemann    -   May 6, 1992
  31.      C            Added '/Z' to the script file to automatically logout
  32.      C            from AUTOSIG (allows unattended operation).  Also, added 
  33.      C            PROGRAM.CTL for variable configuration control.  STRIPPER
  34.      C            was added to the processing stream in ATOSTART.BAT.
  35.      C
  36.      C  Rev. 1A   Clinton D. Huntemann    -   May 13, 1992
  37.      C            Fixed embarassing errors.
  38.      C
  39.      C  Rev. 1B   Clinton D. Huntemann    -   May 23, 1992
  40.      C            Adjusted script file to compensate for missing or not
  41.      C            found symbols.  (Part of overall GETQUOTE fix.)
  42.      C
  43.      C  Rev. 2    Clinton D. Huntemann    -   Oct. 25, 1992
  44.      C            Added code to skip weekends.
  45.      C
  46.      C  Rev. 2A   Clinton D. Huntemann    -   Nov. 27, 1992
  47.      C            Incorporated weekend skip code into subroutine to search a
  48.      C            file NODAYS.DAT for a list of holidays and other days the
  49.      C            market may be closed.
  50.      C
  51.      C  Rev. 2B   Clinton D. Huntemann    -   Jan. 9, 1993
  52.      C            Fixed some poor control commands in ATOSTART.BAT when run
  53.      C            without a PROGRAM.CTL file.
  54.      C
  55. 0002       DIMENSION FNAME1(2),FNAME2(2),MPATH(10),PATH1(10),PATH2(10),
  56.           1PATH3(10),ATO(2),DRV(10)
  57. 0003       REAL RYR,RMO,RDY
  58. 0004       INTEGER MONTH,DAY,YEAR,WEEK,SKIP
  59.      C
  60.      C Update data file name based on system date
  61.      C
  62. 0005       CALL DATE(MONTH,DAY,YEAR,WEEK)
  63. 0006       YEAR = YEAR-100*INT(YEAR/100)
  64. 0007       ENCODE (RMO,2,4001) MONTH
  65. 0008  4001 FORMAT (I2)
  66. 0009       IF (MONTH .LT. 10) ENCODE (RMO,2,4002) MONTH
  67. 0010  4002 FORMAT ('0',I1)
  68. 0011       ENCODE (RDY,2,4001) DAY
  69. 0012       IF (DAY .LT. 10) ENCODE (RDY,2,4002) DAY
  70. 0013       ENCODE (RYR,2,4001) YEAR
  71. 0014       IF (YEAR .LT. 10) ENCODE (RYR,2,4002) YEAR
  72. 0015       ENCODE (FNAME1,14,4003) RYR,RMO,RDY
  73. 0016  4003 FORMAT ('DY',3A2,'.LOG')
  74. 0017       ENCODE (FNAME2,14,4004) RYR,RMO,RDY
  75. 0018  4004 FORMAT ('DY',3A2,'.SCR')
  76.      C
  77.      C Retrieve the configuration file
  78.      C
  79. 0019       DO 51 I=1,10
  80. 0020       DRV(I) = 'C:    '
  81. 0021       MPATH(I)='      '
  82. 0022       PATH1(I)='      '
  83. 0023       PATH2(I)='      '
  84. 0024    51 PATH3(I)='      '
  85. 0025       ENCODE (MPATH,8,5003) '\5C\AUTOSIG'
  86. 0026  5003 FORMAT (10A6)
  87. 0027       ENCODE (PATH1,8,5003) '\5C\AUTOSIG'
  88. 0028       ENCODE (PATH2,8,5003) '\5C\AUTOSIG'
  89. 0029       ENCODE (PATH3,8,5003) '\5C\AUTOSIG'
  90. 0030       ENCODE (ATO,8,5003) 'AUTOSIG '
  91. 0031       IERR=0
  92. 0032       CALL OPEN (4,'PROGRAM.CTL',IERR)
  93. 0033       IF (IERR .NE. 0) GOTO 59
  94. 0034       READ (4,5005) DRV
  95. 0035  5005 FORMAT (12X,10(A2,1X))
  96. 0036       READ (4,5004) ATO
  97. 0037  5004 FORMAT (12X,A6,A2)
  98. 0038       READ (4,5006) MPATH
  99. 0039  5006 FORMAT (12X,10A6)
  100. 0040       READ (4,5006) PATH1
  101. 0041       READ (4,5006) PATH2
  102. 0042       READ (4,5006) PATH3
  103. 0043       CALL CLOSE (4)
  104.      C
  105.      C Update the AUTOSIG Batch File
  106.      C
  107. 0044    59 CALL OPEN (5,'ATOSTART.BAT')
  108. 0045       WRITE (5,4999) FNAME2
  109. 0046  4999 FORMAT ('echo Starting ATOSTART for ',2A6)
  110. 0047       IF ((DRV(1).NE.'C:    ').AND.(DRV(1).NE.'      '))
  111.           1WRITE (5,5000) DRV(1),MPATH
  112. 0048  5000 FORMAT ('SUBST ',A2,' ',10A6)
  113. 0049       IF ((DRV(2).NE.'C:    ').AND.(DRV(2).NE.'      '))
  114.           1WRITE (5,5000) DRV(2),PATH1
  115. 0050       IF ((DRV(3).NE.'C:    ').AND.(DRV(3).NE.'      '))
  116.           1WRITE (5,5000) DRV(3),PATH2
  117. 0051       IF ((DRV(4).NE.'C:    ').AND.(DRV(4).NE.'      '))
  118.           1WRITE (5,5000) DRV(4),PATH3
  119. 0052       CALL NODAY(SKIP)
  120. 0053       IF (SKIP .NE. 0) GOTO 60
  121. 0054       WRITE (5,5002) DRV(1),ATO,FNAME2
  122. 0055  5002 FORMAT ('call ',A2,A6,A2,' /Z/X',2A6)
  123. 0056       WRITE (5,5001)
  124. 0057  5001 FORMAT ('call STRIPPER')
  125. 0058    60 DO 61 M=1,10
  126. 0059    61 IF ((DRV(M).NE.'C:    ').AND.(DRV(M).NE.'      '))
  127.           1WRITE (5,5007) DRV(M)
  128. 0060  5007 FORMAT ('SUBST ',A2,' /d')
  129. 0061       CALL CLOSE (5)
  130.      C
  131.      C Create the .SCR file
  132.      C
  133. 0062       CALL OPEN (5,FNAME2)
  134. 0063       WRITE (5,6000)
  135. 0064  6000 FORMAT (' sendline ATDT %HOSTPHONE'/' match CONNECT')
  136. 0065       WRITE (5,6001)
  137. 0066  6001 FORMAT (' pause 1'/' send ''^C'''/' match ''User ID:''')
  138. 0067       WRITE (5,6002)
  139. 0068  6002 FORMAT (' display ''{'' %COM ''}'''/' sendline %HOSTUSERID')
  140. 0069       WRITE (5,6003)
  141. 0070  6003 FORMAT (' if %hostuserid ''\5C\'' then goto have.pswd')
  142. 0071       WRITE (5,6004)
  143. 0072  6004 FORMAT ('  match ''Password:'''/' sendline %HOSTPASSWORD')
  144. 0073       WRITE (5,6005)
  145. 0074  6005 FORMAT ('label have.pswd'/' sendline SET BRIEF NO'
  146.           1/' match ''choice''')
  147. 0075       WRITE (5,6006) DRV(2),FNAME1
  148. 0076  6006 FORMAT (' capture ',A2,2A6)
  149.      C
  150.      C Open the Ticker List file
  151.      C
  152. 0077       CALL OPEN (4,'TICKER.LST')
  153. 0078    99 WRITE (5,6007)
  154. 0079  6007 FORMAT (' sendline ''GO BASICQUOTE''')
  155. 0080       IF ((WEEK .EQ. 0).OR.(WEEK .EQ. 6)) GOTO 200
  156.      C
  157.      C Cycle through the ticker symbols on file (if not a weekend)
  158.      C
  159. 0081       DO 101 K=1,3
  160. 0082       READ (4,6009,ERR=199,END=200) TICKER
  161. 0083  6009 FORMAT (1A6)
  162. 0084       WRITE (5,6008) TICKER
  163. 0085  6008 FORMAT (' match ''Issue:'''/' sendline ''',A6,Z)
  164. 0086       DO 100 I=2,6
  165. 0087       READ (4,6009,ERR=199,END=101) TICKER
  166. 0088   100 WRITE (5,6010) TICKER
  167. 0089  6010 FORMAT (',',A6,Z)
  168. 0090   101 WRITE (5,6011)
  169. 0091  6011 FORMAT ('''')
  170. 0092       WRITE (5,6012)
  171. 0093  6012 FORMAT (' match ''Issue:'''/' send ''^M''')
  172. 0094       GO TO 99
  173.      C
  174.      C Close the Script file
  175.      C
  176. 0095   200 CALL CLOSE (4)
  177. 0096       WRITE (5,6013)
  178. 0097  6013 FORMAT (' match ''Issue:'''/' capture OFF'/' send ''^M'''/
  179.           1' exit Z')
  180.      C
  181.      C Cleanup and exit
  182.      C
  183. 0098       CALL CLOSE (5)
  184. 0099       WRITE (0,7000) FNAME2,FNAME1
  185. 0100  7000 FORMAT (//'Files ATOSTART.BAT and ',2A6,' created.'/
  186.           1'To start, type ATOSTART'/
  187.           2'File ',2A6,' will be created when ATOSTART is run.'//)
  188. 0101       STOP 'Normal stop'
  189.      C
  190. 0102   199 CALL CLOSE (4)
  191. 0103       CALL CLOSE (5)
  192. 0104       WRITE (0,7099) FNAME2,FNAME2
  193. 0105  7099 FORMAT ('Error creating files ATOSTART.BAT or ',2A6,'.'/
  194.           1'DO NOT USE ',2A6,'.'//)
  195. 0106       STOP 'Abnormal stop'
  196. 0107       END
  197. ** Generated Code =  3166 (Decimal), 0C5E (Hex) Bytes
  198.      
  199. 0001       SUBROUTINE NODAY(SKIP)
  200.      C
  201.      C   This Subroutine looks up a list of dates to skip processing
  202.      C   (i.e. days the market is closed).  It returns SKIP > 0 if current
  203.      C   date is a weekend or matches a date in the list.
  204.      C
  205.      C
  206.      C   Programm Originator:
  207.      C        Clinton D. Huntemann  (71247,2065)
  208.      C        5 Longwood Avenue
  209.      C        Londonderry, New Hampshire 03053
  210.      C        phone (603) 432-7554
  211.      C
  212.      C   Revision History:
  213.      C        Rev. 0 - November 28, 1992       CDH
  214.      C                 Original
  215.      C
  216.      C
  217. 0002       DIMENSION LINE(7)
  218. 0003       INTEGER MONTH,DAY,YEAR,WEEK,SKIP
  219.      C
  220.      C   Get current date
  221.      C
  222. 0004       CALL DATE(MONTH,DAY,YEAR,WEEK)
  223. 0005       IF ((WEEK.EQ.0).OR.(WEEK.EQ.6)) THEN
  224. 0006           SKIP = 6
  225. 0007           TYPE 'Processing skipped for weekends'
  226. 0008           RETURN
  227. 0009           ENDIF
  228.      C
  229.      C   Open list of skipped days
  230.      C
  231. 0010       CALL OPEN (4,'NODAYS.DAT',SKIP)
  232. 0011       IF (SKIP.NE.0) THEN
  233. 0012           TYPE 'NODAYS.DAT file not found'
  234. 0013           SKIP = 0
  235. 0014           RETURN
  236. 0015           ENDIF
  237. 0016       READ (4,1000,END=199) LINE
  238. 0017  1000 FORMAT (7A6)
  239. 0018       READ (4,1000,END=199) LINE
  240.      C
  241.      C   Look for dates match
  242.      C
  243. 0019   100 READ (4,1000,END=199) LINE
  244. 0020       DECODE (LINE,10,1001) IMO,IDY,IYR
  245. 0021  1001 FORMAT (2(I2,1X),I4)
  246. 0022       IF ((IMO.EQ.MONTH).AND.(IDY.EQ.DAY).AND.(IYR.EQ.YEAR)) THEN
  247. 0023           SKIP = 1
  248. 0024           CALL CLOSE (4)
  249. 0025           TYPE 'Processing skipped via NODAYS.DAT entry'
  250. 0026           WRITE (1,1000) LINE
  251. 0027           RETURN
  252. 0028           ENDIF
  253. 0029       GOTO 100
  254. 0030   199 SKIP = 0
  255. 0031       CALL CLOSE (4)
  256. 0032       RETURN
  257. 0033       END
  258. ** Generated Code =   543 (Decimal), 021F (Hex) Bytes
  259.  
  260.  
  261.        No Compile errors
  262.