-
Notifications
You must be signed in to change notification settings - Fork 1
/
ceclCreditCardSearch.txt
112 lines (85 loc) · 2.36 KB
/
ceclCreditCardSearch.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[ ER.CECL.CREDITCARD.SEARCH
Created by
Ethan Roberts
on 05/22/2018
This specfile will read-in credit card numbers from a lettefile and then link the card number to the account number. This is mostly being used for CECL.
*NOTE: Letterfiles CECL.OUTPUT.FILE and CARDNUMS are used with this specfile.
]
TARGET = ACCOUNT
DEFINE
FOUND = NUMBER
TRUE = NUMBER
FALSE = NUMBER
CR=CHARACTER(1)
LF=CHARACTER(1)
TAB=CHARACTER
COUNTER = NUMBER
LOOKUPKEY = CHARACTER
FILENUMBER = NUMBER
FILEERROR = CHARACTER
MATCHFILENUMBER = NUMBER
MATCHFILEERROR = CHARACTER
DELETEERROR = CHARACTER
FOUNDLOOKUP = CHARACTER
END
SETUP
TRUE = 1
FALSE = 0
COUNTER = 0
CR=CTRLCHR(13)
LF=CTRLCHR(10)
TAB=CTRLCHR(9)
FILEDELETE("LETTER","CECL.OUTPUT.FILE",DELETEERROR)
FILEOPEN("LETTER","CECL.OUTPUT.FILE","APPEND",MATCHFILENUMBER,MATCHFILEERROR)
FILEOPEN("LETTER","CARDNUMS","READ",FILENUMBER,FILEERROR)
IF FILEERROR <> "" THEN
DO
PRINT "ERROR! "+FILEERROR
TERMINATE
END
END
SELECT
NONE
END
PRINT TITLE = "CECL Credit-Card Search"
HEADER = ""
WHILE FILEERROR = ""
DO
FILEREADLINE(FILENUMBER,LOOKUPKEY,FILEERROR)
FOUND = FALSE
COUNTER = COUNTER + 1
FOUNDLOOKUP = ""
IF LOOKUPKEY = "" THEN [ line read-in is blank ]
DO
FOUND = TRUE
FILEWRITE(MATCHFILENUMBER,"BLANK ",10,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,CR,1,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,LF,1,MATCHFILEERROR)
END
ELSE
DO
FOR ACCOUNT WITH LOOKUP LOOKUPKEY
DO
IF LOOKUPKEY <> FOUNDLOOKUP THEN [ making sure this card hasn't been processed yet ]
DO
FOUNDLOOKUP = LOOKUPKEY [ storing card into var ]
FOUND = TRUE [ card found on system ]
FILEWRITE(MATCHFILENUMBER,ACCOUNT:NUMBER,10,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,CR,1,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,LF,1,MATCHFILEERROR)
END
END
END
IF FOUND = FALSE THEN [ number does not exist on our system ]
DO
FILEWRITE(MATCHFILENUMBER,"NO MATCH ",10,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,CR,1,MATCHFILEERROR)
FILEWRITE(MATCHFILENUMBER,LF,1,MATCHFILEERROR)
END
END[WHILE]
END
TOTAL
NEWLINE
PRINT "TOTAL LINES PROCESSED: "
PRINT COUNTER-1 [ This is -1 so that the "EOF" line is not counted ]
END