home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
g
/
getquo30.zip
/
STRIPPER.LST
< prev
next >
Wrap
File List
|
1992-10-12
|
13KB
|
400 lines
***** UTAH Fortran 1.0 (Mod 4) ** Compiling File: C:STRIPPER.FOR *****
0001 OPTIONS X
C C:\AUTOSIG\STRIPPER.FOR
C
C This UTAH FORTRAN program strips junk from AUTOSIG's .LOG file after
C accessing BASICQUOTE. It assumes the default directory is C:\AUTOSIG
C and all files are located there. Redirection can be controlled via
C the PROGRAM.CTL file.
C
C Use this routine after MAKE_SCR.EXE, ATOSTART.BAT, and AUTOSIG.EXE
C have created the DYyymmdd.LOG file. Your AUTOSIG must be setup prior
C to using those procedure.
C
C Inputs:
C DYyymmdd.LOG - Session log of the quotes recieved (5 at a time).
C PROGRAM.CTL - Path control file.
C
C Outputs:
C DYyymmdd.PRN - Print file in flat ASCII format with names and header.
C DYyymmdd.DAT - Data file in flat ASCII format with symbols and
C no header.
C where yy - Year
C mm - Month
C dd - Day
C (SYMB). - Stock symbol files.
C
C Rev. 0 Clinton D. Huntemann - May 7, 1992
C (71247,2065)
C
C Rev. 1 Clinton D. Huntemann - May 24, 1992
C (71247,2065)
C Added sorting capability to eliminate not found sysbols
C from DAT, PRN, and (SYMB) files and expanded CTL file
C options for path control. Also added code to create an
C undated TICKER.UPD file. (Speeds things up on next run.)
C
C Rev. 2 Clinton D. Huntemann - June 5, 1992
C (71247,2065)
C Remove duplicate records from [SYMB.] files.
C
C Rev. 3 Clinton D. Huntemann - OCT. 12, 1992
C (71247,2065)
C Added year to archived records.
C
C
0002 DIMENSION FNAME1(3),FNAME2(3),FNAME3(3),LINE(13),SYMB(6),
1LINE2(9),LINE3(9),MPATH(10),PATH1(10),PATH2(10),PATH3(10),ATO(2),
2DRV(10),SYMFIL(2),TMPFIL(2),LINE4(13,6),LINE5(8)
0003 REAL RYR,RMO,RDY
0004 INTEGER MONTH,DAY,YEAR,WEEK
C
C Setup default paths
C
0005 DO 51 I=1,10
0006 DRV(I) = 'C:'
0007 MPATH(I)=' '
0008 PATH1(I)=' '
0009 PATH2(I)=' '
0010 51 PATH3(I)=' '
0011 ENCODE (MPATH,8,5013) '\5C\AUTOSIG'
0012 5013 FORMAT (10A6)
0013 ENCODE (PATH1,8,5013) '\5C\AUTOSIG'
0014 ENCODE (PATH2,8,5013) '\5C\AUTOSIG'
0015 ENCODE (PATH3,8,5013) '\5C\AUTOSIG'
0016 ENCODE (ATO,8,5013) 'AUTOSIG '
C
C Retrieve the configuration file
C
0017 IERR=0
0018 CALL OPEN (4,'PROGRAM.CTL',IERR)
0019 IF (IERR .NE. 0) GOTO 59
C
C Read the available drives (record 1)
C
0020 READ (4,5015) DRV
0021 5015 FORMAT (12X,10(A2,1X))
C
C Read the AUTOSIG.EXE name (record 2)
C
0022 READ (4,5014) ATO
0023 5014 FORMAT (12X,A6,A2)
C
C Read the main file path (record 3)
C
0024 READ (4,5016) MPATH
0025 5016 FORMAT (12X,10A6)
C
C Read the .LOG file path (record 4)
C
0026 READ (4,5016) PATH1
C
C Read the .PRN and .DAT files path (record 5)
C
0027 READ (4,5016) PATH2
C
C Read the .[SYMB.] file path (record 6)
C
0028 READ (4,5016) PATH3
0029 59 CALL CLOSE (4)
C
C Update data file name
C
0030 CALL DATE(MONTH,DAY,YEAR,WEEK)
0031 YEAR = YEAR-100*INT(YEAR/100)
0032 ENCODE (RMO,2,4001) MONTH
0033 4001 FORMAT (I2)
0034 IF (MONTH .LT. 10) ENCODE (RMO,2,4002) MONTH
0035 4002 FORMAT ('0',I1)
0036 ENCODE (RDY,2,4001) DAY
0037 IF (DAY .LT. 10) ENCODE (RDY,2,4002) DAY
0038 ENCODE (RYR,2,4001) YEAR
0039 IF (YEAR .LT. 10) ENCODE (RYR,2,4002) YEAR
0040 ENCODE (FNAME1,14,4003) DRV(2),RYR,RMO,RDY
0041 4003 FORMAT (A2,'DY',3A2,'.LOG')
0042 ENCODE (FNAME2,14,4004) DRV(3),RYR,RMO,RDY
0043 4004 FORMAT (A2,'DY',3A2,'.DAT')
0044 ENCODE (FNAME3,14,4005) DRV(3),RYR,RMO,RDY
0045 4005 FORMAT (A2,'DY',3A2,'.PRN')
C
C Open a new TICKER file for updated list
C
0046 CALL OPEN (2,'TICKER.UPD')
C
C Open the LOG File and skip to first data
C
0047 ICNT = 0
0048 CALL OPEN (5,FNAME1)
0049 10 READ (5,5000,END=100,ERR=199) LINE
0050 5000 FORMAT (13A6)
0051 IF ((LINE(1) .EQ. 'Issue:') .AND. (LINE(2) .NE. ' '))
1 CALL SYMBOL(LINE,SYMB,ISYM)
0052 IF (LINE(7) .NE. ' Hi/As') GOTO 10
C
C Prep header and open PRN and DAT files
C
0053 CALL OPEN (3,FNAME2)
0054 CALL OPEN (4,FNAME3)
0055 WRITE (4,5000) LINE
0056 20 READ (5,5000,END=100,ERR=199) LINE
0057 IF ((LINE(1) .EQ. 'Issue:') .AND. (LINE(2) .NE. ' '))
1 CALL SYMBOL(LINE,SYMB,ISYM)
0058 IF (LINE(7) .NE. ' -----') GOTO 20
0059 IF (ICNT .EQ. 0) WRITE (4,5000) LINE
C
C Cycle through valid data
C
0060 ICTL=0
0061 NSYM=0
0062 DO 30 I=1,ISYM
0063 LINE(7)=' '
0064 READ (5,5000,END=100,ERR=199) LINE
0065 IF (LINE(7) .EQ. ' ') THEN
0066 CALL SYMERR(ISYM,SYMB,ICTL)
0067 GOTO 40
0068 ELSE
0069 NSYM=NSYM+1
0070 DO 22 J=1,13
0071 22 LINE4(J,I)=LINE(J)
0072 ENDIF
0073 30 CONTINUE
C
0074 40 ICNT=ICNT+NSYM
0075 K=0
0076 DO 50 I=1,NSYM
0077 41 K=K+1
0078 IF (SYMB(K).EQ.' ') GOTO 41
C
C Update the TICKER.UPD file
C
0079 WRITE (2,5001) SYMB(K)
0080 5001 FORMAT (A6)
0081 DO 42 J=1,13
0082 42 LINE(J)=LINE4(J,I)
0083 WRITE (4,5000) LINE
0084 WRITE (0,5000) LINE
0085 DECODE (LINE,78,5002) LINE2
0086 5002 FORMAT (27X,8A6,A3)
0087 WRITE (3,5003) SYMB(K),LINE2
0088 5003 FORMAT (A6,2X,8A6,A3)
C
C Look for special [SYMB.] name which causes printer problems
C
0089 IF (SYMB(K) .EQ. 'PRN ') SYMB(K)='PRN_ '
C
C Remove internal blanks in issue symbol.
C
0090 CALL REMBLK(SYMB(K))
0091 ENCODE (SYMFIL,8,5005) DRV(4),SYMB(K)
0092 5005 FORMAT (A2,A6)
0093 ENCODE (TMPFIL,8,5005) DRV(4),'TEMP '
0094 DUPE1=' '
0095 CALL OPEN (7,TMPFIL)
0096 CALL OPEN (6,SYMFIL,IERROR)
0097 IF (IERROR .NE. 0) THEN
0098 GOTO 49
0099 ELSE
C
C Loop to copy old [SYMB.] file to TEMP.
C
0100 45 READ (6,5004,END=48) LINE3
0101 5004 FORMAT (9A6)
0102 DECODE (LINE3,54,5006) DUPE2,FSTAR
0103 5006 FORMAT (45X,A5,A4)
C
C Check for duplicate date/time field in [SYMB.] record and skip
C
0104 IF (DUPE2 .NE. DUPE1) WRITE (7,5004) LINE3
0105 DUPE1=DUPE2
0106 GOTO 45
0107 48 CALL CLOSE (6)
0108 CALL DELETE (SYMFIL)
0109 ENDIF
0110 49 DECODE (LINE2,51,5007) LINE5,DUPE2,FSTAR
0111 5007 FORMAT (7A6,A3,A5,A1)
C
C Check for duplicate date/time field in .LOG record and skip
C
0112 IF (DUPE2 .NE. DUPE1) WRITE (7,5008) LINE5,DUPE2,YEAR,FSTAR
0113 5008 FORMAT (7A6,A3,A5,'/',I2,A1)
0114 CALL CLOSE (7)
C
C Rename TEMP. to [SYMB.]
C
0115 CALL RENAME (TMPFIL,SYMFIL)
0116 50 CONTINUE
0117 GOTO 20
C
C Cleanup and exit
C
0118 100 CALL CLOSE (2)
0119 CALL CLOSE (3)
0120 CALL CLOSE (4)
0121 CALL CLOSE (5)
0122 WRITE (0,7000) FNAME3,FNAME2,FNAME1,ICNT,DRV(4)
0123 7000 FORMAT (//'Files ',2A6,A2,' and ',2A6,A2,' created from ',2A6,A2,
1/,I4,' symbol archive files appended in ',A2//)
0124 STOP 'Normal stop'
C
0125 199 CALL CLOSE (2)
0126 CALL CLOSE (3)
0127 CALL CLOSE (4)
0128 CALL CLOSE (5)
0129 WRITE (0,7099) FNAME2
0130 7099 FORMAT ('Error creating file ',2A6,A2,'.'/'DO NOT USE.'//)
0131 STOP 'Abnormal stop'
0132 END
C
** Generated Code = 3195 (Decimal), 0C7B (Hex) Bytes
0001 SUBROUTINE SYMBOL(LINE,SYMB,ISYM)
C
C This subroutine retrieves the Issue symbols list, counts the
C non-blank symbols in the list, and returns ISYM.
C
C Rev. 0 Clinton D. Huntemann - May 24, 1992
C (71247,2065)
C
0002 DIMENSION LINE(13),SYMB(6)
C
0003 ISYM=0
0004 WRITE (0,5000) LINE
0005 5000 FORMAT (13A6)
0006 DO 100 I=1,6
0007 100 SYMB(I)=' '
0008 DECODE (LINE,49,5001) SYMB
0009 5001 FORMAT (7X,6(A6,1X))
0010 DO 200 I=1,6
0011 200 IF (SYMB(I) .NE. ' ') ISYM=ISYM+1
0012 RETURN
0013 END
C
** Generated Code = 288 (Decimal), 0120 (Hex) Bytes
0001 SUBROUTINE SYMERR(ISYM,SYMB,ICTL)
C
C This subroutine finds the missing symbols in the log file and
C returns adjusted values of ICTL and SYMB.
C
C Rev. 0 Clinton D. Huntemann - May 24, 1992
C (71247,2065)
C
0002 DIMENSION LINE(13),SYMB(6),CHAR(6),PARTS(72)
0003 INTEGER ICNT(6,2)
C
0004 ICTL=0
C
C Step through all SYMBols
C
0005 DO 30 I=1,ISYM
C Clear missing SYMB flag
0006 ICNT(I,2)=0
C Clear the CHAR variable
0007 DO 10 J=1,6
0008 10 CHAR(J)=' '
C
C Parse SYMB(I)
C
0009 CHECK=SYMB(I)
0010 DECODE (CHECK,6,5001) CHAR
0011 5001 FORMAT (6A1)
C Look for last non-blank character in SYMB(I)
0012 DO 20 J=6,1,-1
0013 20 IF (CHAR(J) .NE. ' ') GOTO 30
C Set ICNT(I,1) to length of SYMB(I)
0014 30 ICNT(I,1)=J
C
C Read next LOG file line
C
0015 35 READ (5,5000) LINE
0016 5000 FORMAT (13A6)
C Parse LINE into characters
0017 DECODE (LINE,72,5002) PARTS
0018 5002 FORMAT (72A1)
0019 K=0
C
C Loop to check all SYMB(I)
C
0020 DO 50 I=1,ISYM
C Clear the CHAR variable
0021 DO 40 J=1,6
0022 40 CHAR(J)=' '
C
C Parse SYMB(I)
C
0023 CHECK=SYMB(I)
0024 DECODE (CHECK,6,5001) CHAR
C Retrieve length of SYMB(I)
0025 MCNT=ICNT(I,1)
C Search LINE for SYMB(I)
0026 DO 45 J=1,MCNT
0027 M=K+J
C Match character by character
0028 45 IF (CHAR(J) .NE. PARTS(M)) GOTO 50
C Set found flag & placeholder in LINE
0029 ICNT(I,2)=1
0030 K=K+MCNT+1
C Look for end off missing SYMB list
0031 IF (PARTS(K) .EQ. ' ') GOTO 200
0032 50 CONTINUE
C Recycle to read next line if no end found.
0033 GOTO 35
C
C Look for 'not found' string in log file LINE
C
0034 200 IF ((PARTS(K+1).EQ.'n ').AND.(PARTS(K+2).EQ.'o ')
1.AND.(PARTS(K+3).EQ.'t ').AND.(PARTS(K+4).EQ.' ')
2.AND.(PARTS(K+5).EQ.'f ').AND.(PARTS(K+6).EQ.'o ')
3.AND.(PARTS(K+7).EQ.'u ').AND.(PARTS(K+8).EQ.'n ')
4.AND.(PARTS(K+9).EQ.'d ')) THEN
C Set missing SYMB(I) to ' ' and increment missing counter
C to adjust ISYM back in MAIN program.
0035 DO 210 I=1,ISYM
0036 IF (ICNT(I,2).EQ.1) THEN
0037 SYMB(I)=' '
0038 ICTL=ICTL+1
0039 ENDIF
0040 210 CONTINUE
C Show 'not found' line on screen and return.
0041 WRITE (0,5000) LINE
0042 RETURN
C Recycle to read next line in LOG file if not lagit 'not found'
0043 ELSE
0044 GOTO 35
0045 ENDIF
0046 END
C
** Generated Code = 1305 (Decimal), 0519 (Hex) Bytes
0001 SUBROUTINE REMBLK(CHECK)
C
C This subroutine finds imbedded blanks in the symbol and replaces
C with underline.
C
C Rev. 0 Clinton D. Huntemann - May 24, 1992
C (71247,2065)
C
0002 DIMENSION CHAR(6)
C
C Clear the CHAR data area.
0003 DO 10 J=1,6
0004 10 CHAR(J)=' '
C Parse CHECK into characters
0005 DECODE (CHECK,6,5001) CHAR
0006 5001 FORMAT (6A1)
C Look for last non-blank character in CHECK
0007 DO 20 J=6,1,-1
0008 20 IF (CHAR(J) .NE. ' ') GOTO 30
C Change any blank characters to '_' within CHECK
0009 30 DO 40 K=J,1,-1
0010 40 IF (CHAR(K) .EQ. ' ') CHAR(K)='_ '
C Reassemble CHECK and return
0011 ENCODE (CHECK,6,5001) CHAR
0012 RETURN
0013 END
** Generated Code = 310 (Decimal), 0136 (Hex) Bytes
No Compile errors