-
Notifications
You must be signed in to change notification settings - Fork 0
/
WEBVISITRD.RPGLE
224 lines (179 loc) · 6.7 KB
/
WEBVISITRD.RPGLE
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
*****************************************************************
* Web IP Records File Maintenance Delete
*
* Program WEBVISITRD
*****************************************************************
h dftactgrp(*no) actgrp('RDWRITES') bnddir('RDWRITES')
h debug option(*srcstmt:*nodebugio)
*****************************************************************
* File Specifications
*****************************************************************
* WEBIPRECRD override file
fwebiprecrduf e k disk rename(WEBVISITR: IPRECRD)
* Display File
fwebvisitddcf e workstn
*****************************************************************
*Entry Declaration
*****************************************************************
d WEBVISITRD pr
d prmErrorCode like(returnCode)
d prmExit like(flag)
d prmFile like(pgmnam)
d prmSite like(WEBSITE)
d prmVisitor like(VISITOR)
d WEBVISITRD pi
d prmErrorCode like(returnCode)
d prmExit like(flag)
d prmFile like(pgmnam)
d prmSite like(WEBSITE)
d prmVisitor like(VISITOR)
*****************************************************************
* Prototype Definitions
*****************************************************************
/copy RDWSRC,WEBVISITPR
*****************************************************************
* Data Structure Declaration
*****************************************************************
* function keys and indicators
d @Indicator s * inz(%addr(*IN))
d Indicators ds based(@Indicator)
d Exit 03 03
d Cancel 12 12
d DeleteRec 22 22
d SflMsgEnd 98 98
*****************************************************************
* Stand Alone Fields Declaration
*****************************************************************
d wrkCfmflg s like(flag)
*****************************************************************
* Mainline
*****************************************************************
/free
chain (prmSite: prmVISITOR) WEBIPRECRD;
if not %found(WEBIPRECRD);
prmErrorCode = wrkError;
exsr exitProgram;
endif;
write SCN04;
exsr clrMsg;
exsr setSCN04;
dou Exit = *on or Cancel = *on;
write MSGCTL;
exfmt SCN04;
exsr clrMsg;
select;
// F3 Exit pressed
when Exit = *on;
prmExit = Exit;
leave;
// F12 Return pressed
when Cancel = *on;
leave;
// F22 Delete pressed
when DeleteRec = *on;
exsr cfmDel;
if wrkCfmflg = 'N';
iter;
endif;
delete(e) IPRECRD;
if %error;
exsr IOSysErr;
leave;
endif;
prmErrorCode = wrkSuccess;
leave;
// Enter pressed
other;
prmMsgfile = msgFile;
prmMsgid = 'RDW0007';
// 'Press F22 to delete.'
exsr sndmsgid;
endsl;
enddo;
// Exit program
exsr exitProgram;
//**************************************************************
// Subroutine: setSCN04
//**************************************************************
begsr setSCN04;
S4FILE = prmFile;
S4SITE = WEBSITE;
S4VISITOR = VISITOR;
callp setIPSEG(IPSEG1
:IPSEG2
:IPSEG3
:IPSEG4
:S4IPSEG1
:S4IPSEG2
:S4IPSEG3
:S4IPSEG4);
S4HOST = HOST;
S4CITY = CITY;
S4STATE = STATE;
S4TOPIC = TOPIC;
S4USER = USER;
S4SEARCH = SEARCH;
endsr;
//**************************************************************
// Subroutine: cfmDel
//**************************************************************
begsr cfmDel;
wrkCfmflg = 'N';
write MSGCTL;
exfmt DELCFMWR;
select;
// F3 Exit pressed
when Exit = *on;
Exit = *off;
leavesr;
// F12 Return pressed
when Cancel = *on;
Cancel = *off;
leavesr;
// Enter pressed
other;
wrkCfmflg = 'Y';
endsl;
endsr;
//**************************************************************
// Subroutine: clrMsg
//**************************************************************
begsr clrMsg;
SflMsgEnd = *on;
write MSGCTL;
SflMsgEnd = *off;
clrmsgc();
endsr;
//**************************************************************
// Subroutine: sndMsgid
// parms: prmMsgfile message file
// prmMsgid message id to send
//**************************************************************
begsr sndMsgid;
sndmsgidc(prmMsgfile: prmMsgid);
endsr;
//**************************************************************
begsr IOSysErr;
prmErrorCode = wrkError;
prmMsgfile = msgFile;
prmMsgid = 'RDW0010';
// 'Record I/O failure.'
exsr sndmsgid;
endsr;
//**************************************************************
// Subroutine: exitProgram
//**************************************************************
begsr exitProgram;
*inlr = *on;
return;
endsr;
//**************************************************************
// Subroutine: *inzsr
//**************************************************************
begsr *inzsr;
// default return code
prmErrorCode = wrkFailure;
prmExit = *blanks;
pgmsgq = pgmnam;
endsr;
/end-free