janus-llm 4.3.1__py3-none-any.whl → 4.4.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- janus/__init__.py +1 -1
- janus/__main__.py +1 -1
- janus/_tests/evaluator_tests/EvalReadMe.md +85 -0
- janus/_tests/evaluator_tests/incose_tests/incose_large_test.json +39 -0
- janus/_tests/evaluator_tests/incose_tests/incose_small_test.json +17 -0
- janus/_tests/evaluator_tests/inline_comment_tests/mumps_inline_comment_test.m +71 -0
- janus/_tests/test_cli.py +3 -2
- janus/cli/aggregate.py +135 -0
- janus/cli/cli.py +117 -0
- janus/cli/constants.py +49 -0
- janus/cli/database.py +289 -0
- janus/cli/diagram.py +207 -0
- janus/cli/document.py +183 -0
- janus/cli/embedding.py +122 -0
- janus/cli/llm.py +191 -0
- janus/cli/partition.py +134 -0
- janus/cli/pipeline.py +123 -0
- janus/cli/self_eval.py +147 -0
- janus/cli/translate.py +192 -0
- janus/converter/__init__.py +1 -1
- janus/converter/_tests/test_translate.py +7 -5
- janus/converter/chain.py +180 -0
- janus/converter/converter.py +444 -153
- janus/converter/diagram.py +8 -6
- janus/converter/document.py +27 -16
- janus/converter/evaluate.py +143 -144
- janus/converter/partition.py +2 -10
- janus/converter/requirements.py +4 -40
- janus/converter/translate.py +3 -59
- janus/embedding/collections.py +1 -1
- janus/language/alc/_tests/alc.asm +3779 -0
- janus/language/binary/_tests/hello.bin +0 -0
- janus/language/block.py +78 -14
- janus/language/file.py +1 -1
- janus/language/mumps/_tests/mumps.m +235 -0
- janus/language/treesitter/_tests/languages/fortran.f90 +416 -0
- janus/language/treesitter/_tests/languages/ibmhlasm.asm +16 -0
- janus/language/treesitter/_tests/languages/matlab.m +225 -0
- janus/llm/models_info.py +9 -1
- janus/metrics/_tests/asm_test_file.asm +10 -0
- janus/metrics/_tests/mumps_test_file.m +6 -0
- janus/metrics/_tests/test_treesitter_metrics.py +1 -1
- janus/metrics/metric.py +47 -124
- janus/metrics/prompts/clarity.txt +8 -0
- janus/metrics/prompts/completeness.txt +16 -0
- janus/metrics/prompts/faithfulness.txt +10 -0
- janus/metrics/prompts/hallucination.txt +16 -0
- janus/metrics/prompts/quality.txt +8 -0
- janus/metrics/prompts/readability.txt +16 -0
- janus/metrics/prompts/usefulness.txt +16 -0
- janus/parsers/code_parser.py +4 -4
- janus/parsers/doc_parser.py +12 -9
- janus/parsers/parser.py +7 -0
- janus/parsers/partition_parser.py +6 -4
- janus/parsers/reqs_parser.py +11 -8
- janus/parsers/uml.py +5 -4
- janus/prompts/prompt.py +2 -2
- janus/prompts/templates/README.md +30 -0
- janus/prompts/templates/basic_aggregation/human.txt +6 -0
- janus/prompts/templates/basic_aggregation/system.txt +1 -0
- janus/prompts/templates/basic_refinement/human.txt +14 -0
- janus/prompts/templates/basic_refinement/system.txt +1 -0
- janus/prompts/templates/diagram/human.txt +9 -0
- janus/prompts/templates/diagram/system.txt +1 -0
- janus/prompts/templates/diagram_with_documentation/human.txt +15 -0
- janus/prompts/templates/diagram_with_documentation/system.txt +1 -0
- janus/prompts/templates/document/human.txt +10 -0
- janus/prompts/templates/document/system.txt +1 -0
- janus/prompts/templates/document_cloze/human.txt +11 -0
- janus/prompts/templates/document_cloze/system.txt +1 -0
- janus/prompts/templates/document_cloze/variables.json +4 -0
- janus/prompts/templates/document_cloze/variables_asm.json +4 -0
- janus/prompts/templates/document_inline/human.txt +13 -0
- janus/prompts/templates/eval_prompts/incose/human.txt +32 -0
- janus/prompts/templates/eval_prompts/incose/system.txt +1 -0
- janus/prompts/templates/eval_prompts/incose/variables.json +3 -0
- janus/prompts/templates/eval_prompts/inline_comments/human.txt +49 -0
- janus/prompts/templates/eval_prompts/inline_comments/system.txt +1 -0
- janus/prompts/templates/eval_prompts/inline_comments/variables.json +3 -0
- janus/prompts/templates/micromanaged_mumps_v1.0/human.txt +23 -0
- janus/prompts/templates/micromanaged_mumps_v1.0/system.txt +3 -0
- janus/prompts/templates/micromanaged_mumps_v2.0/human.txt +28 -0
- janus/prompts/templates/micromanaged_mumps_v2.0/system.txt +3 -0
- janus/prompts/templates/micromanaged_mumps_v2.1/human.txt +29 -0
- janus/prompts/templates/micromanaged_mumps_v2.1/system.txt +3 -0
- janus/prompts/templates/multidocument/human.txt +15 -0
- janus/prompts/templates/multidocument/system.txt +1 -0
- janus/prompts/templates/partition/human.txt +22 -0
- janus/prompts/templates/partition/system.txt +1 -0
- janus/prompts/templates/partition/variables.json +4 -0
- janus/prompts/templates/pseudocode/human.txt +7 -0
- janus/prompts/templates/pseudocode/system.txt +7 -0
- janus/prompts/templates/refinement/fix_exceptions/human.txt +19 -0
- janus/prompts/templates/refinement/fix_exceptions/system.txt +1 -0
- janus/prompts/templates/refinement/format/code_format/human.txt +12 -0
- janus/prompts/templates/refinement/format/code_format/system.txt +1 -0
- janus/prompts/templates/refinement/format/requirements_format/human.txt +14 -0
- janus/prompts/templates/refinement/format/requirements_format/system.txt +1 -0
- janus/prompts/templates/refinement/hallucination/human.txt +13 -0
- janus/prompts/templates/refinement/hallucination/system.txt +1 -0
- janus/prompts/templates/refinement/reflection/human.txt +15 -0
- janus/prompts/templates/refinement/reflection/incose/human.txt +26 -0
- janus/prompts/templates/refinement/reflection/incose/system.txt +1 -0
- janus/prompts/templates/refinement/reflection/incose_deduplicate/human.txt +16 -0
- janus/prompts/templates/refinement/reflection/incose_deduplicate/system.txt +1 -0
- janus/prompts/templates/refinement/reflection/system.txt +1 -0
- janus/prompts/templates/refinement/revision/human.txt +16 -0
- janus/prompts/templates/refinement/revision/incose/human.txt +16 -0
- janus/prompts/templates/refinement/revision/incose/system.txt +1 -0
- janus/prompts/templates/refinement/revision/incose_deduplicate/human.txt +17 -0
- janus/prompts/templates/refinement/revision/incose_deduplicate/system.txt +1 -0
- janus/prompts/templates/refinement/revision/system.txt +1 -0
- janus/prompts/templates/refinement/uml/alc_fix_variables/human.txt +15 -0
- janus/prompts/templates/refinement/uml/alc_fix_variables/system.txt +2 -0
- janus/prompts/templates/refinement/uml/fix_connections/human.txt +15 -0
- janus/prompts/templates/refinement/uml/fix_connections/system.txt +2 -0
- janus/prompts/templates/requirements/human.txt +13 -0
- janus/prompts/templates/requirements/system.txt +2 -0
- janus/prompts/templates/retrieval/language_docs/human.txt +10 -0
- janus/prompts/templates/retrieval/language_docs/system.txt +1 -0
- janus/prompts/templates/simple/human.txt +16 -0
- janus/prompts/templates/simple/system.txt +3 -0
- janus/refiners/format.py +49 -0
- janus/refiners/refiner.py +113 -4
- janus/utils/enums.py +127 -112
- janus/utils/logger.py +2 -0
- {janus_llm-4.3.1.dist-info → janus_llm-4.4.5.dist-info}/METADATA +18 -18
- janus_llm-4.4.5.dist-info/RECORD +210 -0
- {janus_llm-4.3.1.dist-info → janus_llm-4.4.5.dist-info}/WHEEL +1 -1
- janus_llm-4.4.5.dist-info/entry_points.txt +3 -0
- janus/cli.py +0 -1488
- janus/metrics/_tests/test_llm.py +0 -90
- janus/metrics/llm_metrics.py +0 -202
- janus_llm-4.3.1.dist-info/RECORD +0 -115
- janus_llm-4.3.1.dist-info/entry_points.txt +0 -3
- {janus_llm-4.3.1.dist-info → janus_llm-4.4.5.dist-info}/LICENSE +0 -0
@@ -0,0 +1,3779 @@
|
|
1
|
+
*
|
2
|
+
* PROGRAM: ZFAM001
|
3
|
+
* AUTHOR: Rich Jackson and Randy Frerking
|
4
|
+
* COMMENTS: zFAM - z/OS Frerking Access Manager
|
5
|
+
*
|
6
|
+
* This program is executed as the initial zFAM HTTP/HTTPS
|
7
|
+
* request to determine which zFAM execution mode.
|
8
|
+
*
|
9
|
+
* When the query string is not zQl (or is not present),
|
10
|
+
* this is Basic Mode.
|
11
|
+
*
|
12
|
+
* When the query string is zQL,
|
13
|
+
* this is Query Mode.
|
14
|
+
*
|
15
|
+
* Basic Authentication is managed in this program for both
|
16
|
+
* modes of operation. Row and field level security are
|
17
|
+
* performed in this program.
|
18
|
+
*
|
19
|
+
* HTTP in Basic Mode is allowed under the following rules:
|
20
|
+
* 1). Only for GET requests, and
|
21
|
+
* 2). Only when Basic Mode Read Only is enabled
|
22
|
+
*
|
23
|
+
* HTTP in Query Mode is allowed under the following rules:
|
24
|
+
* 1). Only for GET requests, and
|
25
|
+
* 2). Only when Query Mode Read Only is enabled
|
26
|
+
*
|
27
|
+
* After performing Basic Authentication, field/row level
|
28
|
+
* security, zQL parsing, field containers, etc, control
|
29
|
+
* will be transfered to the following programs:
|
30
|
+
*
|
31
|
+
* ZFAM002 - Basic Mode row level access
|
32
|
+
* POST LINK to ZFAM011 When Column Index defined
|
33
|
+
* PUT LINK to ZFAM031 When Column Index defined
|
34
|
+
* DELETE LINK to ZFAM041 When Column Index defined
|
35
|
+
*
|
36
|
+
* ZFAM010 - Query Mode POST
|
37
|
+
* ZFAM020 - Query Mode GET
|
38
|
+
* ZFAM022 - Query Mode GET when Column Index requested
|
39
|
+
* ZFAM030 - Query Mode PUT
|
40
|
+
* ZFAM040 - Query Mode DELETE
|
41
|
+
*
|
42
|
+
*
|
43
|
+
***********************************************************************
|
44
|
+
* Start Dynamic Storage Area *
|
45
|
+
***********************************************************************
|
46
|
+
DFHEISTG DSECT
|
47
|
+
REGSAVE DS 16F Register Save Area
|
48
|
+
APPLID DS CL08 CICS Applid
|
49
|
+
SYSID DS CL04 CICS SYSID
|
50
|
+
SD_GM DS F FAxxSD GETMAIN address
|
51
|
+
FD_GM DS F FAxxFD GETMAIN address
|
52
|
+
SD_LEN DS F FAxxSD GETMAIN length
|
53
|
+
FD_LEN DS F FAxxFD GETMAIN length
|
54
|
+
PA_GM DS F Parser Array address
|
55
|
+
PA_LEN DS F Parser Array length
|
56
|
+
SD_RESP DS F FAxxSD DOCUMENT CREATE EIBRESP
|
57
|
+
FD_RESP DS F FAxxFD DOCUMENT CREATE EIBRESP
|
58
|
+
WR_ADDR DS F WEB RECEIVE buffer address
|
59
|
+
WR_LEN DS F WEB RECEIVE buffer address
|
60
|
+
QS_ADDR DS F Query string address
|
61
|
+
BAS_REG DS F BAS return register
|
62
|
+
DS 0F
|
63
|
+
BM_PROG DS CL08 Basic Mode service program
|
64
|
+
QM_PROG DS CL08 Query Mode service program
|
65
|
+
W_ADDR DS F Beginning field/where address
|
66
|
+
W_LEN DS CL04 Packed decimal field length
|
67
|
+
W_TOTAL DS CL08 Packed decimal total length
|
68
|
+
W_COLUMN DS CL08 Packed decimal column number
|
69
|
+
W_PACK DS CL08 Packed decimal work field
|
70
|
+
DS 0F
|
71
|
+
X_NAME DS CL16 Field Name (during search)
|
72
|
+
DS 0F
|
73
|
+
W_NAME DS CL16 Field Name (container name)
|
74
|
+
W_LENGTH DS F Field Length (container data)
|
75
|
+
W_INDEX DS F Parser array index
|
76
|
+
DS 0F
|
77
|
+
W_FIELDS DS CL01 Command indicator
|
78
|
+
W_WHERE DS CL01 Command indicator
|
79
|
+
W_WITH DS CL01 Command indicator
|
80
|
+
W_TTL DS CL01 Command indicator
|
81
|
+
W_OPTION DS CL01 Command indicator
|
82
|
+
W_FORM DS CL01 Command indicator
|
83
|
+
W_DIST DS CL01 Command indicator
|
84
|
+
W_MODE DS CL01 Command indicator
|
85
|
+
W_SORT DS CL01 Command indicator
|
86
|
+
W_ROWS DS CL01 Command indicator
|
87
|
+
*
|
88
|
+
W_CI DS CL01 FAxxFD CI indicator
|
89
|
+
*
|
90
|
+
W_SIGN DS CL01 Where sign
|
91
|
+
*
|
92
|
+
W_PREFIX DS CL01 URI prefix
|
93
|
+
* When a replicate request is sent
|
94
|
+
* in the URI prefix, set this byte to
|
95
|
+
* X'FF'. This will be used to allow
|
96
|
+
* HTTP requests for both BM and QM
|
97
|
+
*
|
98
|
+
***********************************************************************
|
99
|
+
* WEB EXTRACT fields *
|
100
|
+
***********************************************************************
|
101
|
+
DS 0F
|
102
|
+
W_SCHEME DS F Scheme (HTTP/HTTPS)
|
103
|
+
L_METHOD DS F Method length
|
104
|
+
L_PATH DS F Path length
|
105
|
+
L_QUERY DS F Query string length
|
106
|
+
DS 0F
|
107
|
+
W_METHOD DS CL06 Method (GET, PUT, POST, DELETE)
|
108
|
+
E_METHOD EQU *-W_METHOD Method field length
|
109
|
+
DS 0F
|
110
|
+
W_PATH DS CL512 Path information
|
111
|
+
E_PATH EQU *-W_PATH Path field length
|
112
|
+
W_QUERY DS CL03 Query string information
|
113
|
+
E_QUERY EQU *-W_QUERY Query field length
|
114
|
+
***********************************************************************
|
115
|
+
* READ HTTPHEADER fields - Authorization *
|
116
|
+
***********************************************************************
|
117
|
+
DS 0F
|
118
|
+
L_HEADER DS F HTTP header length
|
119
|
+
V_LENGTH DS F HTTP header value length
|
120
|
+
*
|
121
|
+
A_VALUE DS CL64 HTTP header value
|
122
|
+
A_VAL_L EQU *-A_VALUE HTTP header value field length
|
123
|
+
***********************************************************************
|
124
|
+
* READ HTTPHEADER fields - zFAM-Stream *
|
125
|
+
***********************************************************************
|
126
|
+
DS 0F
|
127
|
+
Z_VALUE DS CL03 HTTP header value
|
128
|
+
Z_VAL_L EQU *-Z_VALUE HTTP header value field length
|
129
|
+
***********************************************************************
|
130
|
+
* WEB RECEIVE fields *
|
131
|
+
***********************************************************************
|
132
|
+
DS 0F
|
133
|
+
R_LENGTH DS F WEB RECEIVE length
|
134
|
+
R_MAX DS F WEB RECEIVE maximum length
|
135
|
+
R_MEDIA DS CL56 WEB RECEIVE media type
|
136
|
+
***********************************************************************
|
137
|
+
* zDECODE communication area *
|
138
|
+
* Base64Binary decoding of Basic Authentication credentials *
|
139
|
+
***********************************************************************
|
140
|
+
C_DECODE DS 0F
|
141
|
+
C_RC DS CL02 Return code
|
142
|
+
DS CL02 Not used
|
143
|
+
C_USER DS CL08 UserID
|
144
|
+
C_PASS DS CL08 Password
|
145
|
+
C_ECODE DS CL24 Encoded UserID:Password
|
146
|
+
DS CL04 Not used
|
147
|
+
C_DCODE DS CL18 Decoded UserID:Password
|
148
|
+
E_DECODE EQU *-C_DECODE Communication data length
|
149
|
+
*
|
150
|
+
***********************************************************************
|
151
|
+
* zFAM090 communication area *
|
152
|
+
* Logging for zFAM001 exceptional conditions *
|
153
|
+
***********************************************************************
|
154
|
+
C_LOG DS 0F
|
155
|
+
C_STATUS DS CL03 HTTP Status code
|
156
|
+
C_REASON DS CL02 Reason Code
|
157
|
+
C_USERID DS CL08 UserID
|
158
|
+
C_PROG DS CL08 Service program name
|
159
|
+
C_FILE DS CL08 File name
|
160
|
+
C_FIELD DS CL16 zQL field name in 412 condition
|
161
|
+
E_LOG EQU *-C_LOG Commarea Data length
|
162
|
+
L_LOG DS H Commarea length
|
163
|
+
*
|
164
|
+
***********************************************************************
|
165
|
+
* Document Template names. *
|
166
|
+
***********************************************************************
|
167
|
+
DS 0F
|
168
|
+
SD_TOKEN DS CL16 SD document token
|
169
|
+
SD_DOCT DS 0CL48
|
170
|
+
SD_TRAN DS CL04 SD EIBTRNID
|
171
|
+
SD_TYPE DS CL02 SD Type
|
172
|
+
SD_SPACE DS CL42 SD Spaces
|
173
|
+
DS 0F
|
174
|
+
FD_TOKEN DS CL16 FD document token
|
175
|
+
FD_DOCT DS 0CL48
|
176
|
+
FD_TRAN DS CL04 FD EIBTRNID
|
177
|
+
FD_TYPE DS CL02 FD Type
|
178
|
+
FD_SPACE DS CL42 FD Spaces
|
179
|
+
*
|
180
|
+
***********************************************************************
|
181
|
+
* SELECT options. *
|
182
|
+
* Primary Key attributes must be included for SELECT requests using *
|
183
|
+
* secondary column index. This is necessary as the Primary Key must *
|
184
|
+
* be returned on all SELECT requests. *
|
185
|
+
***********************************************************************
|
186
|
+
O_TABLE DS 0F
|
187
|
+
O_P_COL DS PL04 Primary Key column number
|
188
|
+
O_P_LEN DS PL04 Primary Key field length
|
189
|
+
O_P_TYPE DS CL01 Primary Key field type
|
190
|
+
DS CL03 Alignment
|
191
|
+
O_P_NAME DS CL16 Primary Key field name
|
192
|
+
*
|
193
|
+
O_FORM DS CL09 Format message
|
194
|
+
* FIXED - delimited by field size
|
195
|
+
* XML - tags using field name
|
196
|
+
* JSON - tags using field name
|
197
|
+
* DELIMITER - field delimiter
|
198
|
+
* Default - FIXED
|
199
|
+
*
|
200
|
+
DS CL03 Alignment
|
201
|
+
*
|
202
|
+
O_DIST DS CL03 Distinct messages returned
|
203
|
+
* YES - Duplicates not returned
|
204
|
+
* NO - Duplicates returned
|
205
|
+
* Default - NO
|
206
|
+
*
|
207
|
+
DS CL01 Alignment
|
208
|
+
*
|
209
|
+
O_MODE DS CL08 Type of SELECT process
|
210
|
+
* ONLINE - Synchronous request
|
211
|
+
* OFFLINE - Asynchronous request
|
212
|
+
* Default - ONLINE
|
213
|
+
*
|
214
|
+
O_SORT DS CL16 Sort order by field name
|
215
|
+
* FieldName - Ascending sort by field
|
216
|
+
* Default - Primary key
|
217
|
+
*
|
218
|
+
O_ROWS DS CL06 Maximum rows returned
|
219
|
+
* 0 - All available rows
|
220
|
+
* 1-999999 - Maximum rows returned
|
221
|
+
* Default - 0 (All available)
|
222
|
+
*
|
223
|
+
DS CL02 Alignment
|
224
|
+
O_WITH DS CL02 Type of Read (WITH)
|
225
|
+
* UR - Uncommitted Read
|
226
|
+
* CR - Committed Read
|
227
|
+
* Default - UR
|
228
|
+
*
|
229
|
+
DS CL02 Alignment
|
230
|
+
E_TABLE EQU *-O_TABLE Length of Option table
|
231
|
+
*
|
232
|
+
***********************************************************************
|
233
|
+
* End Dynamic Storage Area *
|
234
|
+
***********************************************************************
|
235
|
+
*
|
236
|
+
***********************************************************************
|
237
|
+
* Start FAxxSD DOCTEMPLATE buffer (Security Definitions) *
|
238
|
+
***********************************************************************
|
239
|
+
*
|
240
|
+
SD_DSECT DSECT
|
241
|
+
B_TEXT DS CL22 Basic Mode Read Only - text
|
242
|
+
B_STATUS DS CL03 Basic Mode Read Only - status
|
243
|
+
DS CL02 CRLF
|
244
|
+
Q_TEXT DS CL22 Query Mode Read Only - text
|
245
|
+
Q_STATUS DS CL03 Query Mode Read Only - status
|
246
|
+
DS CL02 CRLF
|
247
|
+
E_PREFIX EQU *-B_TEXT Security Definition prefix length
|
248
|
+
*
|
249
|
+
SD_USER DSECT
|
250
|
+
B_USER DS CL05 User=
|
251
|
+
S_USER DS CL08 UserID
|
252
|
+
DS CL01 ,
|
253
|
+
S_TYPE DS CL06 Type (Read, Write, Delete)
|
254
|
+
DS CL01 ,
|
255
|
+
E_SD EQU *-B_USER Security levels displacement
|
256
|
+
S_LEVELS DS CL33 Security levels
|
257
|
+
DS CL01 space
|
258
|
+
DS CL01 end of field marker
|
259
|
+
DS CL02 CRLF
|
260
|
+
E_USER EQU *-B_USER User entry length
|
261
|
+
***********************************************************************
|
262
|
+
* End FAxxSD DOCTEMPLATE buffer *
|
263
|
+
***********************************************************************
|
264
|
+
*
|
265
|
+
***********************************************************************
|
266
|
+
* Start FAxxFD DOCTEMPLATE buffer (Field Definitions) *
|
267
|
+
***********************************************************************
|
268
|
+
*
|
269
|
+
FD_DSECT DSECT
|
270
|
+
DS CL03 ID=
|
271
|
+
F_ID DS CL03 Field ID
|
272
|
+
DS CL05 ,Col=
|
273
|
+
F_COL DS CL07 Field column number
|
274
|
+
DS CL05 ,Len=
|
275
|
+
F_LEN DS CL06 Field length
|
276
|
+
DS CL06 ,Type=
|
277
|
+
F_TYPE DS CL01 Field type (Character or Numeric)
|
278
|
+
DS CL05 ,Sec=
|
279
|
+
F_SEC DS CL02 Field security level
|
280
|
+
DS CL06 ,Name=
|
281
|
+
F_NAME DS CL16 Field name
|
282
|
+
DS CL01 end of field marker
|
283
|
+
DS CL02 CRLF
|
284
|
+
E_FD EQU *-FD_DSECT Field Definition entry length
|
285
|
+
***********************************************************************
|
286
|
+
* End FAxxSD DOCTEMPLATE buffer *
|
287
|
+
***********************************************************************
|
288
|
+
*
|
289
|
+
***********************************************************************
|
290
|
+
* Start Parser Array (maximum 256 fields) *
|
291
|
+
***********************************************************************
|
292
|
+
*
|
293
|
+
PA_DSECT DSECT
|
294
|
+
P_ID DS PL02 Field ID
|
295
|
+
P_SEC DS PL02 Field level security
|
296
|
+
P_COL DS PL04 Field column
|
297
|
+
P_LEN DS PL04 Field length
|
298
|
+
P_TYPE DS CL01 Field type
|
299
|
+
P_WHERE DS CL01 WHERE indicator
|
300
|
+
P_SEG DS H Field record segment
|
301
|
+
P_NAME DS CL16 Field Name
|
302
|
+
E_PA EQU *-P_ID PA entry length
|
303
|
+
***********************************************************************
|
304
|
+
* End Parser Array *
|
305
|
+
***********************************************************************
|
306
|
+
*
|
307
|
+
***********************************************************************
|
308
|
+
* Start WEB RECEIVE buffer *
|
309
|
+
***********************************************************************
|
310
|
+
*
|
311
|
+
WR_DSECT DSECT
|
312
|
+
***********************************************************************
|
313
|
+
* End WEB RECEIVE buffer *
|
314
|
+
***********************************************************************
|
315
|
+
*
|
316
|
+
***********************************************************************
|
317
|
+
* Start Data Container buffer *
|
318
|
+
***********************************************************************
|
319
|
+
*
|
320
|
+
DC_DSECT DSECT
|
321
|
+
***********************************************************************
|
322
|
+
* End Data Container buffer *
|
323
|
+
***********************************************************************
|
324
|
+
*
|
325
|
+
***********************************************************************
|
326
|
+
* Start DFHCOMMAREA *
|
327
|
+
***********************************************************************
|
328
|
+
*
|
329
|
+
DFHCA DSECT
|
330
|
+
C_QUERY DS CL8192 Query string information
|
331
|
+
***********************************************************************
|
332
|
+
* End DFHCOMMAREA *
|
333
|
+
***********************************************************************
|
334
|
+
*
|
335
|
+
***********************************************************************
|
336
|
+
* Control Section - ZFAM001 *
|
337
|
+
***********************************************************************
|
338
|
+
***********************************************************************
|
339
|
+
ZFAM001 DFHEIENT CODEREG=(R2,R3,12),DATAREG=R10,EIBREG=R11
|
340
|
+
ZFAM001 AMODE 31
|
341
|
+
ZFAM001 RMODE 31
|
342
|
+
B SYSDATE BRANCH AROUND LITERALS
|
343
|
+
DC CL08'ZFAM001 '
|
344
|
+
DC CL48' -- Initial zFAM control service '
|
345
|
+
DC CL08' '
|
346
|
+
DC CL08'&SYSDATE'
|
347
|
+
DC CL08' '
|
348
|
+
DC CL08'&SYSTIME'
|
349
|
+
SYSDATE DS 0H
|
350
|
+
***********************************************************************
|
351
|
+
* Extract relevant WEB information regarding this request. *
|
352
|
+
* Since the WEB EXTRACT command moves the Query String 'into' an area *
|
353
|
+
* instead of setting a pointer, only a three byte area is defined for *
|
354
|
+
* the EXTRACT command. The three bytes are used to determine whether *
|
355
|
+
* the request is basic mode or query mode (zQL). When query mode, *
|
356
|
+
* parse the DFHCOMMAREA for the beginning of the query string and *
|
357
|
+
* save the pointer address. This reduces the amount of DFHEISTG *
|
358
|
+
* storage required for the Query String and eliminates a GETMAIN. *
|
359
|
+
* *
|
360
|
+
* Create Access-Control-Allow-Origin HTTP Header for all zFAM modules.*
|
361
|
+
* *
|
362
|
+
***********************************************************************
|
363
|
+
SY_0010 DS 0H
|
364
|
+
EXEC CICS WEB WRITE X
|
365
|
+
HTTPHEADER (H_ACAO) X
|
366
|
+
NAMELENGTH (H_ACAO_L) X
|
367
|
+
VALUE (M_ACAO) X
|
368
|
+
VALUELENGTH(M_ACAO_L) X
|
369
|
+
NOHANDLE
|
370
|
+
*
|
371
|
+
LA R1,E_PATH Load path field length
|
372
|
+
ST R1,L_PATH Save path field length
|
373
|
+
LA R1,E_METHOD Load method field length
|
374
|
+
ST R1,L_METHOD Save method field length
|
375
|
+
LA R1,E_QUERY Load query field length
|
376
|
+
ST R1,L_QUERY Save query field length
|
377
|
+
*
|
378
|
+
EXEC CICS WEB EXTRACT X
|
379
|
+
SCHEME(W_SCHEME) X
|
380
|
+
HTTPMETHOD(W_METHOD) X
|
381
|
+
METHODLENGTH(L_METHOD) X
|
382
|
+
PATH(W_PATH) X
|
383
|
+
PATHLENGTH(L_PATH) X
|
384
|
+
QUERYSTRING(W_QUERY) X
|
385
|
+
QUERYSTRLEN(L_QUERY) X
|
386
|
+
NOHANDLE
|
387
|
+
*
|
388
|
+
CLC W_PATH(10),REPLIC8 URI '/replicate' prefix?
|
389
|
+
BC B'0111',*+8 ... no, continue
|
390
|
+
MVI W_PREFIX,X'FF' ... yes, set replicate flag
|
391
|
+
*
|
392
|
+
CLC L_QUERY,MAX_QS Query string maximum exceeded?
|
393
|
+
BC B'0010',ER_41401 ... yes, set return code
|
394
|
+
*
|
395
|
+
CLC EIBRESP2,=F'30' Path length exceeded?
|
396
|
+
BC B'1000',ER_41402 ... yes, set return code
|
397
|
+
*
|
398
|
+
CLC W_SCHEME,DFHVALUE(HTTP) HTTP (non-SSL) request?
|
399
|
+
BC B'1000',SY_0050 ... yes, skip READ HTTPHEADER
|
400
|
+
*
|
401
|
+
CLC W_PATH(10),URI_DS /datastore request?
|
402
|
+
BC B'0111',SY_0050 ... no, skip HTTPHEADER
|
403
|
+
*
|
404
|
+
***********************************************************************
|
405
|
+
* Read HTTPHEADER to obtain Basic Authentication credentials. *
|
406
|
+
***********************************************************************
|
407
|
+
SY_0020 DS 0H
|
408
|
+
LA R1,A_LENGTH Load header name length
|
409
|
+
ST R1,L_HEADER Save header name length
|
410
|
+
LA R1,A_VAL_L Load value field length
|
411
|
+
ST R1,V_LENGTH Save value field length
|
412
|
+
*
|
413
|
+
EXEC CICS WEB READ HTTPHEADER(A_HEADER) X
|
414
|
+
NAMELENGTH(L_HEADER) X
|
415
|
+
VALUE(A_VALUE) X
|
416
|
+
VALUELENGTH(V_LENGTH) X
|
417
|
+
NOHANDLE
|
418
|
+
*
|
419
|
+
OC EIBRESP,EIBRESP Normal response?
|
420
|
+
BC B'0111',ER_40101 ... no, set return message
|
421
|
+
*
|
422
|
+
CLC V_LENGTH,SIX Value length greater than six?
|
423
|
+
BC B'1100',ER_40102 ... no, set return message
|
424
|
+
*
|
425
|
+
***********************************************************************
|
426
|
+
* Call zDECODE. *
|
427
|
+
* Base64Binary decoding of Basic Authentication credentials *
|
428
|
+
***********************************************************************
|
429
|
+
SY_0030 DS 0H
|
430
|
+
MVC C_ECODE,A_VALUE+6 Move encoded UserID:Password
|
431
|
+
LA R1,C_DECODE Load zDECODE communication area
|
432
|
+
ST R13,DFHEIR13 Save R13 (old RSA)
|
433
|
+
LA R13,DFHEISA Load R13 (new RSA)
|
434
|
+
L R15,DECODE Load zDECODE address
|
435
|
+
BASR R14,R15 Call zDECODE routine
|
436
|
+
L R13,DFHEIR13 Load R13
|
437
|
+
*
|
438
|
+
OC C_USER,HEX_40 Set upper case bits on
|
439
|
+
MVC C_USERID,C_USER Move UserID to logging COMMAREA
|
440
|
+
*
|
441
|
+
CLI C_RC+1,X'F0' Return Code zero?
|
442
|
+
BC B'0111',ER_40102 ... no, STATUS(401)
|
443
|
+
*
|
444
|
+
EXEC CICS VERIFY USERID(C_USER) PASSWORD(C_PASS) X
|
445
|
+
NOHANDLE
|
446
|
+
OC EIBRESP,EIBRESP Return Code zero?
|
447
|
+
BC B'0111',ER_40103 ... no, STATUS(401)
|
448
|
+
*
|
449
|
+
***********************************************************************
|
450
|
+
* Get Security DOCTEMPLATE (FAxxSD) *
|
451
|
+
***********************************************************************
|
452
|
+
SY_0050 DS 0H
|
453
|
+
EXEC CICS GETMAIN X
|
454
|
+
SET(R9) X
|
455
|
+
FLENGTH(SD_GM_L) X
|
456
|
+
INITIMG(HEX_00) X
|
457
|
+
NOHANDLE
|
458
|
+
*
|
459
|
+
ST R9,SD_GM Save GETMAIN address
|
460
|
+
USING SD_DSECT,R9 ... tell assembler
|
461
|
+
*
|
462
|
+
MVC SD_LEN,SD_GM_L Set document length
|
463
|
+
MVC SD_TRAN(2),FA_PRE Set document TransId prefix
|
464
|
+
MVC SD_TRAN+2(2),EIBTRNID+2 Set document TransID suffix
|
465
|
+
MVC SD_TYPE,=C'SD' Set document type
|
466
|
+
MVI SD_SPACE,X'40' Set first byte
|
467
|
+
MVC SD_SPACE+1(41),SD_SPACE Set remainder of bytes
|
468
|
+
*
|
469
|
+
EXEC CICS DOCUMENT CREATE DOCTOKEN(SD_TOKEN) X
|
470
|
+
TEMPLATE(SD_DOCT) X
|
471
|
+
RESP (SD_RESP) X
|
472
|
+
NOHANDLE
|
473
|
+
*
|
474
|
+
OC EIBRESP,EIBRESP Normal response?
|
475
|
+
BC B'0111',SY_0060 ... no, bypass RETRIEVE
|
476
|
+
*
|
477
|
+
EXEC CICS DOCUMENT RETRIEVE DOCTOKEN(SD_TOKEN) X
|
478
|
+
INTO (SD_DSECT) X
|
479
|
+
LENGTH (SD_LEN) X
|
480
|
+
MAXLENGTH(SD_LEN) X
|
481
|
+
RESP (SD_RESP) X
|
482
|
+
DATAONLY X
|
483
|
+
NOHANDLE
|
484
|
+
*
|
485
|
+
DROP R9 ... tell assembler
|
486
|
+
*
|
487
|
+
***********************************************************************
|
488
|
+
* Get Field DOCTEMPLATE (FAxxFD) *
|
489
|
+
***********************************************************************
|
490
|
+
SY_0060 DS 0H
|
491
|
+
EXEC CICS GETMAIN X
|
492
|
+
SET(R9) X
|
493
|
+
FLENGTH(FD_GM_L) X
|
494
|
+
INITIMG(HEX_00) X
|
495
|
+
NOHANDLE
|
496
|
+
*
|
497
|
+
ST R9,FD_GM Save GETMAIN address
|
498
|
+
USING FD_DSECT,R9 ... tell assembler
|
499
|
+
*
|
500
|
+
MVC FD_LEN,FD_GM_L Set document length
|
501
|
+
MVC FD_TRAN(2),FA_PRE Set document TransId prefix
|
502
|
+
MVC FD_TRAN+2(2),EIBTRNID+2 Set document TransID suffix
|
503
|
+
MVC FD_TYPE,=C'FD' Set document type
|
504
|
+
MVI FD_SPACE,X'40' Set first byte
|
505
|
+
MVC FD_SPACE+1(41),FD_SPACE Set remainder of bytes
|
506
|
+
*
|
507
|
+
EXEC CICS DOCUMENT CREATE DOCTOKEN(FD_TOKEN) X
|
508
|
+
TEMPLATE(FD_DOCT) X
|
509
|
+
RESP (FD_RESP) X
|
510
|
+
NOHANDLE
|
511
|
+
*
|
512
|
+
OC EIBRESP,EIBRESP Normal response?
|
513
|
+
BC B'0111',SY_0090 ... no, bypass RETRIEVE
|
514
|
+
*
|
515
|
+
EXEC CICS DOCUMENT RETRIEVE DOCTOKEN(FD_TOKEN) X
|
516
|
+
INTO (FD_DSECT) X
|
517
|
+
LENGTH (FD_LEN) X
|
518
|
+
MAXLENGTH(FD_LEN) X
|
519
|
+
RESP (FD_RESP) X
|
520
|
+
DATAONLY X
|
521
|
+
NOHANDLE
|
522
|
+
*
|
523
|
+
OC EIBRESP,EIBRESP Normal response?
|
524
|
+
BC B'0111',SY_0090 ... no, bypass PUT CONTAINER
|
525
|
+
*
|
526
|
+
***********************************************************************
|
527
|
+
* This routine intentionally left blank. *
|
528
|
+
* The PUT CONTAINER for FAxxFD has been moved to BM_0400. *
|
529
|
+
***********************************************************************
|
530
|
+
SY_0070 DS 0H
|
531
|
+
SY_0080 DS 0H
|
532
|
+
BC B'1111',SY_0090 Bypass PUT CONTAINER
|
533
|
+
DROP R9 ... tell assembler
|
534
|
+
*
|
535
|
+
***********************************************************************
|
536
|
+
* Check mode of operation and branch accordingly. *
|
537
|
+
***********************************************************************
|
538
|
+
SY_0090 DS 0H
|
539
|
+
CLC L_QUERY,=F'3' Three bytes present?
|
540
|
+
BC B'0100',BM_0010 ... no, Basic mode request
|
541
|
+
*
|
542
|
+
OC W_QUERY(3),HEX_40 Set upper case bits
|
543
|
+
CLC W_QUERY(3),ZQL Query Mode specified?
|
544
|
+
BC B'1000',QM_0010 ... yes, Query Mode request
|
545
|
+
BC B'0111',BM_0010 ... no, Basic Mode request
|
546
|
+
*
|
547
|
+
***********************************************************************
|
548
|
+
* Basic Mode *
|
549
|
+
* *
|
550
|
+
* Begin security *
|
551
|
+
* *
|
552
|
+
* When SCHEME is HTTP *
|
553
|
+
* When GET *
|
554
|
+
* When FAxxSD not defined (development only) *
|
555
|
+
* XCTL ZFAM002 *
|
556
|
+
* When FAxxSD is defined (QA and production) *
|
557
|
+
* When Basic Mode Read Only is enabled *
|
558
|
+
* XCTL ZFAM002 *
|
559
|
+
* When Basic Mode Read Only is disabled *
|
560
|
+
* WEB SEND STATUS(401) *
|
561
|
+
* When PUT, POST, DELETE *
|
562
|
+
* When FAxxSD is defined (QA and production) *
|
563
|
+
* WEB SEND STATUS(401) *
|
564
|
+
* *
|
565
|
+
* When SCHEME is HTTPS *
|
566
|
+
* When FAxxSD is defined (QA and production) *
|
567
|
+
* Compare UserID with FAxxSD *
|
568
|
+
* When UserID not equal security level for type of access *
|
569
|
+
* WEB SEND STATUS(401) *
|
570
|
+
* *
|
571
|
+
* End of security *
|
572
|
+
* *
|
573
|
+
* When FAxxFD and CI defined, ZFAM002 (Basic Mode) will perform the *
|
574
|
+
* appropriate process, then will transfer control to the following: *
|
575
|
+
* *
|
576
|
+
* When POST *
|
577
|
+
* XCTL ZFAM011 *
|
578
|
+
* When PUT *
|
579
|
+
* XCTL ZFAM031 *
|
580
|
+
* When DELETE *
|
581
|
+
* XCTL ZFAM041 *
|
582
|
+
* *
|
583
|
+
* At this point (all conditions confirm Basic Mode processing) *
|
584
|
+
* XCTL ZFAM002 *
|
585
|
+
* *
|
586
|
+
***********************************************************************
|
587
|
+
BM_0010 DS 0H
|
588
|
+
CLI W_PREFIX,X'FF' URI '/replicate' prefix?
|
589
|
+
BC B'1000',BM_0300 ... yes, bypass security
|
590
|
+
*
|
591
|
+
L R9,SD_GM Load FAxxSD address
|
592
|
+
USING SD_DSECT,R9 ... tell assembler
|
593
|
+
CLC W_SCHEME,DFHVALUE(HTTP) HTTP request?
|
594
|
+
BC B'1000',BM_0100 ... yes, execute HTTP security
|
595
|
+
BC B'0111',BM_0200 ... no, execute HTTPS security
|
596
|
+
***********************************************************************
|
597
|
+
* SCHEME is HTTP. Determine appropriate action *
|
598
|
+
***********************************************************************
|
599
|
+
BM_0100 DS 0H
|
600
|
+
CLC W_METHOD(3),S_GET GET request?
|
601
|
+
BC B'0111',BM_0120 ... no, check other methods
|
602
|
+
***********************************************************************
|
603
|
+
* SCHEME is HTTP and this is a GET request *
|
604
|
+
***********************************************************************
|
605
|
+
BM_0110 DS 0H
|
606
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
607
|
+
BC B'0111',BM_0300 ... no, Check for FAxxFD
|
608
|
+
* BC B'0111',BM_0500 ... no, XCTL to ZFAM002
|
609
|
+
OC B_STATUS,HEX_40 Set upper case bits
|
610
|
+
CLC B_STATUS,S_YEA BM Read Only enabled?
|
611
|
+
BC B'1000',BM_0300 ... yes, Check for FAxxFD
|
612
|
+
* BC B'1000',BM_0500 ... yes, XCTL to ZFAM002
|
613
|
+
BC B'0111',ER_40104 ... no, STATUS(401)
|
614
|
+
***********************************************************************
|
615
|
+
* SCHEME is HTTP and this is a PUT, POST, DELETE request *
|
616
|
+
***********************************************************************
|
617
|
+
BM_0120 DS 0H
|
618
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
619
|
+
BC B'1000',ER_40105 ... yes, STATUS(401)
|
620
|
+
BC B'0111',BM_0300 ... no, continue validation
|
621
|
+
***********************************************************************
|
622
|
+
* SCHEME is HTTPS. Determine appropriate action *
|
623
|
+
***********************************************************************
|
624
|
+
BM_0200 DS 0H
|
625
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
626
|
+
BC B'0111',BM_0300 ... no, continue validation
|
627
|
+
*
|
628
|
+
LA R4,E_USER Load user entry length
|
629
|
+
L R5,SD_LEN Load SD template length
|
630
|
+
LA R6,E_PREFIX Load SD prefix length
|
631
|
+
SR R5,R6 Subtract prefix length
|
632
|
+
AR R9,R6 Point to User entry
|
633
|
+
USING SD_USER,R9 ... tell assembler
|
634
|
+
*
|
635
|
+
***********************************************************************
|
636
|
+
* Parse SD entry until EOT or a UserID match *
|
637
|
+
***********************************************************************
|
638
|
+
BM_0210 DS 0H
|
639
|
+
CLC S_USER,C_USER UserID match FAxxSD?
|
640
|
+
BC B'1000',BM_0220 ... yes, check access level
|
641
|
+
BM_0211 DS 0H
|
642
|
+
LA R9,0(R4,R9) Point to next entry
|
643
|
+
SR R5,R4 Subtract user entry length
|
644
|
+
BC B'0010',BM_0210 Continue search
|
645
|
+
BC B'1111',ER_40106 EOT, STATUS(401)
|
646
|
+
***********************************************************************
|
647
|
+
* UserID matches FAxxSD entry. *
|
648
|
+
* Now check HTTP METHOD and branch to compare with security entry *
|
649
|
+
***********************************************************************
|
650
|
+
BM_0220 DS 0H
|
651
|
+
OC S_TYPE,HEX_40 Set upper case bits
|
652
|
+
CLC W_METHOD(4),S_POST POST request?
|
653
|
+
BC B'1000',BM_0221 ... yes, check SD type
|
654
|
+
CLC W_METHOD(3),S_GET GET request?
|
655
|
+
BC B'1000',BM_0222 ... yes, check SD type
|
656
|
+
CLC W_METHOD(3),S_PUT PUT request?
|
657
|
+
BC B'1000',BM_0223 ... yes, check SD type
|
658
|
+
CLC W_METHOD(6),S_DELETE DELETE request?
|
659
|
+
BC B'1000',BM_0224 ... yes, check SD type
|
660
|
+
BC B'0111',ER_40001 ... no, WEB SEND STATUS(400)
|
661
|
+
***********************************************************************
|
662
|
+
* FAxxSD security entry must match HTTP METHOD *
|
663
|
+
* POST must match request type of 'Write ' *
|
664
|
+
***********************************************************************
|
665
|
+
BM_0221 DS 0H
|
666
|
+
CLC S_TYPE,S_WRITE Security entry for 'Write'?
|
667
|
+
BC B'0111',BM_0211 ... no, continue search
|
668
|
+
OI S_LEVELS,X'40' Set upper case bit
|
669
|
+
CLI S_LEVELS,C'X' Row level (0) set?
|
670
|
+
BC B'1000',BM_0300 ... yes, continue validation
|
671
|
+
BC B'1111',ER_40107 ... no, STATUS(401)
|
672
|
+
***********************************************************************
|
673
|
+
* FAxxSD security entry must match HTTP METHOD *
|
674
|
+
* GET must match request type of 'Read ' *
|
675
|
+
***********************************************************************
|
676
|
+
BM_0222 DS 0H
|
677
|
+
CLC S_TYPE,S_READ Security entry for 'Read'?
|
678
|
+
BC B'0111',BM_0211 ... no, continue search
|
679
|
+
OI S_LEVELS,X'40' Set upper case bit
|
680
|
+
CLI S_LEVELS,C'X' Row level (0) set?
|
681
|
+
BC B'1000',BM_0300 ... yes, continue validation
|
682
|
+
BC B'1111',ER_40108 ... no, STATUS(401)
|
683
|
+
***********************************************************************
|
684
|
+
* FAxxSD security entry must match HTTP METHOD *
|
685
|
+
* PUT must match request type of 'Write ' *
|
686
|
+
***********************************************************************
|
687
|
+
BM_0223 DS 0H
|
688
|
+
CLC S_TYPE,S_WRITE Security entry for 'Write'?
|
689
|
+
BC B'0111',BM_0211 ... no, continue search
|
690
|
+
OI S_LEVELS,X'40' Set upper case bit
|
691
|
+
CLI S_LEVELS,C'X' Row level (0) set?
|
692
|
+
BC B'1000',BM_0300 ... yes, continue validation
|
693
|
+
BC B'1111',ER_40109 ... no, STATUS(401)
|
694
|
+
***********************************************************************
|
695
|
+
* FAxxSD security entry must match HTTP METHOD *
|
696
|
+
* DELETE must match request type of 'Delete' *
|
697
|
+
***********************************************************************
|
698
|
+
BM_0224 DS 0H
|
699
|
+
CLC S_TYPE,S_DELETE Security entry for 'Delete'?
|
700
|
+
BC B'0111',BM_0211 ... no, continue search
|
701
|
+
OI S_LEVELS,X'40' Set upper case bit
|
702
|
+
CLI S_LEVELS,C'X' Row level (0) set?
|
703
|
+
BC B'1000',BM_0300 ... yes, continue validation
|
704
|
+
BC B'1111',ER_40110 ... no, STATUS(401)
|
705
|
+
*
|
706
|
+
***********************************************************************
|
707
|
+
* At this point, all validation rules have been performed for *
|
708
|
+
* Basic Mode. Prior to this routine, a BRANCH could have been made *
|
709
|
+
* to XCTL to ZFAM002. All other cases fall thru to this routine to *
|
710
|
+
* determine if Basic Mode is being requested for a table that has *
|
711
|
+
* fields defined. If any of the fields are defined as Column Index, *
|
712
|
+
* issue PUT CONTAINER for FAxxFD, which will be used by zFAM002 to *
|
713
|
+
* LINK to program to process secondary column indexes. *
|
714
|
+
***********************************************************************
|
715
|
+
BM_0300 DS 0H
|
716
|
+
DROP R9 ... tell assembler
|
717
|
+
L R9,FD_GM Load FAxxFD address
|
718
|
+
USING FD_DSECT,R9 ... tell assembler
|
719
|
+
OC FD_RESP,FD_RESP FAxxFD defined?
|
720
|
+
BC B'0111',BM_0500 ... no, XCTL ZFAM002
|
721
|
+
LA R4,E_FD Load field entry length
|
722
|
+
L R5,FD_LEN Load FD template length
|
723
|
+
***********************************************************************
|
724
|
+
* Parse FD entry until EOT or a column index is encountered *
|
725
|
+
***********************************************************************
|
726
|
+
BM_0310 DS 0H
|
727
|
+
CLC F_COL,=C'0000001' Column number 1 (primary key)?
|
728
|
+
BC B'1000',BM_0320 ... yes, skip this one
|
729
|
+
CLC F_ID,=C'000' Field ID number?
|
730
|
+
BC B'0010',BM_0400 ... no, Basic Mode CI process
|
731
|
+
***********************************************************************
|
732
|
+
* Point to next entry until EOT *
|
733
|
+
***********************************************************************
|
734
|
+
BM_0320 DS 0H
|
735
|
+
LA R9,0(R4,R9) Point to next entry
|
736
|
+
SR R5,R4 Subtract field entry length
|
737
|
+
BC B'0010',BM_0310 Continue search
|
738
|
+
BC B'1111',BM_0500 EOT, standard Basic Mode
|
739
|
+
***********************************************************************
|
740
|
+
* Basic Mode with FAxxFD and column index defined. *
|
741
|
+
* Transfer control to Basic Mode (row level) service program and *
|
742
|
+
* provide the FXxxFD. This will signal ZFAM002 to transfer control *
|
743
|
+
* to the Column Index service program to insert/update the secondary *
|
744
|
+
* Column Index stores. *
|
745
|
+
***********************************************************************
|
746
|
+
BM_0400 DS 0H
|
747
|
+
MVC W_ADDR,FD_GM Move FAxxFD address
|
748
|
+
MVC W_LENGTH,FD_LEN Move FAxxFD length
|
749
|
+
MVC W_NAME,C_FAXXFD Move FAxxFD container name
|
750
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
751
|
+
***********************************************************************
|
752
|
+
* Basic Mode primary program. *
|
753
|
+
***********************************************************************
|
754
|
+
BM_0500 DS 0H
|
755
|
+
MVC BM_PROG,ZFAM002 Move Basic Mode primary program
|
756
|
+
*
|
757
|
+
***********************************************************************
|
758
|
+
* Transfer control to Basic Mode (row level) program *
|
759
|
+
***********************************************************************
|
760
|
+
BM_0600 DS 0H
|
761
|
+
EXEC CICS XCTL PROGRAM(BM_PROG) X
|
762
|
+
CHANNEL(C_CHAN) X
|
763
|
+
NOHANDLE
|
764
|
+
BC B'1111',ER_50001 Oops, something's wrong!
|
765
|
+
*
|
766
|
+
***********************************************************************
|
767
|
+
* Query Mode *
|
768
|
+
* *
|
769
|
+
* When POST/PUT *
|
770
|
+
* WEB RECEIVE *
|
771
|
+
* *
|
772
|
+
* GETMAIN parser array storage *
|
773
|
+
* *
|
774
|
+
* Parse querystring (GET/DELETE) or buffer (POST/PUT) *
|
775
|
+
* Create primary key container *
|
776
|
+
* Create field/data containers *
|
777
|
+
* Create array of container names *
|
778
|
+
* Create array container *
|
779
|
+
* Create WITH UR/CR container (for LOCK logic) *
|
780
|
+
* *
|
781
|
+
* Begin Query Mode security *
|
782
|
+
* *
|
783
|
+
* When SCHEME is HTTP *
|
784
|
+
* When GET *
|
785
|
+
* When FAxxSD is defined (QA and production) *
|
786
|
+
* When Query Mode Read Only is disabled *
|
787
|
+
* WEB SEND STATUS(401) *
|
788
|
+
* When Query Mode Read Only is enabled *
|
789
|
+
* Bypass field level security *
|
790
|
+
* When FAxxSD not defined (development) *
|
791
|
+
* Bypass security *
|
792
|
+
* *
|
793
|
+
* When PUT, POST, DELETE *
|
794
|
+
* When FAxxSD is defined (QA and production) *
|
795
|
+
* WEB SEND STATUS(401) *
|
796
|
+
* When FAxxSD not defined (development) *
|
797
|
+
* Bypass security *
|
798
|
+
* *
|
799
|
+
* When SCHEME is HTTPS *
|
800
|
+
* When FAxxSD is defined (QA and production *
|
801
|
+
* Parse FAxxSD until match on UserID *
|
802
|
+
* When UserID not equal security level for type of access *
|
803
|
+
* WEB SEND STATUS(401) *
|
804
|
+
* When FAxxSD not defined (development) *
|
805
|
+
* Bypass security *
|
806
|
+
* *
|
807
|
+
* End of Query Mode security *
|
808
|
+
* *
|
809
|
+
* *
|
810
|
+
* *
|
811
|
+
* When POST *
|
812
|
+
* XCTL ZFAM010 *
|
813
|
+
* *
|
814
|
+
* When GET *
|
815
|
+
* When SELECT specifies primary column index *
|
816
|
+
* XCTL ZFAM020 *
|
817
|
+
* When SELECT specifies secondary column index *
|
818
|
+
* XCTL ZFAM022 *
|
819
|
+
* *
|
820
|
+
* When PUT *
|
821
|
+
* XCTL ZFAM030 *
|
822
|
+
* *
|
823
|
+
* When DELETE *
|
824
|
+
* XCTL ZFAM040 *
|
825
|
+
* *
|
826
|
+
* *
|
827
|
+
***********************************************************************
|
828
|
+
***********************************************************************
|
829
|
+
* Query Mode process. *
|
830
|
+
***********************************************************************
|
831
|
+
***********************************************************************
|
832
|
+
* *
|
833
|
+
***********************************************************************
|
834
|
+
* Issue GETMAIN for parser array *
|
835
|
+
***********************************************************************
|
836
|
+
QM_0010 DS 0H
|
837
|
+
OC FD_RESP,FD_RESP FAxxFD defined?
|
838
|
+
BC B'0111',ER_40505 ... no, Query Mode not allowed
|
839
|
+
*
|
840
|
+
EXEC CICS GETMAIN X
|
841
|
+
SET(R8) X
|
842
|
+
FLENGTH(PA_GM_L) X
|
843
|
+
INITIMG(HEX_00) X
|
844
|
+
NOHANDLE
|
845
|
+
*
|
846
|
+
ST R8,PA_GM Save GETMAIN address
|
847
|
+
MVC PA_LEN,PA_GM_L Save GETMAIN length
|
848
|
+
***********************************************************************
|
849
|
+
* When POST/PUT requests, issue WEB RECEIVE *
|
850
|
+
***********************************************************************
|
851
|
+
QM_0020 DS 0H
|
852
|
+
CLC W_METHOD(6),S_DELETE DELETE request?
|
853
|
+
BC B'1000',QM_0030 ... yes, nothing to receive
|
854
|
+
CLC W_METHOD(3),S_GET GET request?
|
855
|
+
BC B'1000',QM_0030 ... yes, nothing to receive
|
856
|
+
*
|
857
|
+
MVC R_LENGTH,S_WR_LEN Move WEB RECEIVE length
|
858
|
+
MVC R_MAX,S_WR_LEN Move WEB RECEIVE length
|
859
|
+
*
|
860
|
+
EXEC CICS WEB RECEIVE X
|
861
|
+
SET(R8) X
|
862
|
+
LENGTH (R_LENGTH) X
|
863
|
+
MAXLENGTH(R_MAX) X
|
864
|
+
MEDIATYPE(R_MEDIA) X
|
865
|
+
SRVCONVERT X
|
866
|
+
NOHANDLE
|
867
|
+
ST R8,WR_ADDR Save WEB RECEIVE buffer address
|
868
|
+
*
|
869
|
+
CLC EIBRESP2,=F'16' MAXLENGTH exceeded?
|
870
|
+
BC B'1000',ER_41301 ... yes, set return code
|
871
|
+
*
|
872
|
+
CLC R_LENGTH,=F'00' Length received is zero?
|
873
|
+
BC B'1000',ER_41101 ... yes, set return code
|
874
|
+
*
|
875
|
+
OC EIBRESP,EIBRESP Normal response?
|
876
|
+
BC B'0111',ER_40003 ... no, set return code
|
877
|
+
***********************************************************************
|
878
|
+
* Check method and branch accordingly *
|
879
|
+
***********************************************************************
|
880
|
+
QM_0030 DS 0H
|
881
|
+
CLC W_METHOD(4),S_POST POST request?
|
882
|
+
BC B'1000',QM_0100 ... yes, parse POST request
|
883
|
+
CLC W_METHOD(3),S_GET GET request?
|
884
|
+
BC B'1000',QM_0200 ... yes, parse GET request
|
885
|
+
CLC W_METHOD(3),S_PUT PUT request?
|
886
|
+
BC B'1000',QM_0300 ... yes, parse PUT request
|
887
|
+
CLC W_METHOD(6),S_DELETE DELETE request?
|
888
|
+
BC B'1000',QM_0400 ... yes, parse DELETE request
|
889
|
+
BC B'1111',ER_40004 ... no, send STATUS(400)
|
890
|
+
*
|
891
|
+
***********************************************************************
|
892
|
+
* Parse POST request, using WEB RECEIVE input *
|
893
|
+
***********************************************************************
|
894
|
+
QM_0100 DS 0H
|
895
|
+
L R4,R_LENGTH Load RECEIVE length
|
896
|
+
L R5,WR_ADDR Load RECEIVE address
|
897
|
+
*
|
898
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
899
|
+
CLC 0(6,R5),S_INSERT Is this an INSERT command?
|
900
|
+
BC B'0111',ER_40501 ... no, invalid command
|
901
|
+
LA R5,6(,R5) Point to next byte
|
902
|
+
S R4,=F'06' Adjust remaining length
|
903
|
+
BC B'1100',QM_0500 INSERT with no fields
|
904
|
+
* ... this is actually ok
|
905
|
+
*
|
906
|
+
CLI 0(R5),C',' Is next byte a comma?
|
907
|
+
BC B'0111',ER_40006 ... no, syntax error
|
908
|
+
LA R5,1(,R5) Point to next byte
|
909
|
+
S R4,=F'01' Adjust remaining length
|
910
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
911
|
+
***********************************************************************
|
912
|
+
* Check POST request for zQL commands. *
|
913
|
+
* Valid commands are FIELDS and TTL. *
|
914
|
+
***********************************************************************
|
915
|
+
QM_0110 DS 0H
|
916
|
+
LA R0,QM_0110 Mark the spot
|
917
|
+
CLI 0(R5),C'(' Open parenthesis?
|
918
|
+
BC B'0111',ER_40006 ... no, syntax error
|
919
|
+
LA R5,1(,R5) Point to next byte
|
920
|
+
S R4,=F'01' Adjust remaining length
|
921
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
922
|
+
*
|
923
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
924
|
+
CLC 0(3,R5),S_TTL Is this a TTL command?
|
925
|
+
BC B'1000',QM_0120 ... yes, process
|
926
|
+
CLC 0(6,R5),S_FIELDS Is this a FIELDS command?
|
927
|
+
BC B'1000',QM_0130 ... yes, process
|
928
|
+
BC B'1111',ER_40006 ... no, syntax error
|
929
|
+
***********************************************************************
|
930
|
+
* Process TTL command *
|
931
|
+
***********************************************************************
|
932
|
+
QM_0120 DS 0H
|
933
|
+
CLI W_TTL,C'Y' TTL command performed?
|
934
|
+
BC B'1000',ER_40006 ... yes, syntax error
|
935
|
+
***********************************************************************
|
936
|
+
* Begin parsing TTL command *
|
937
|
+
***********************************************************************
|
938
|
+
QM_0121 DS 0H
|
939
|
+
LA R0,QM_0121 Mark the spot
|
940
|
+
LA R5,3(,R5) Point past command
|
941
|
+
S R4,=F'03' Adjust remaining length
|
942
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
943
|
+
*
|
944
|
+
CLI 0(R5),C'(' Begin bracket?
|
945
|
+
BC B'0111',ER_40006 ... no, syntax error
|
946
|
+
LA R5,1(,R5) Point to next byte
|
947
|
+
S R4,=F'01' Adjust remaining length
|
948
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
949
|
+
XR R1,R1 Clear counter
|
950
|
+
ST R5,W_ADDR Save beginning TTL address
|
951
|
+
***********************************************************************
|
952
|
+
* Determine length of TTL and perform editing. *
|
953
|
+
***********************************************************************
|
954
|
+
QM_0122 DS 0H
|
955
|
+
LA R0,QM_0122 Mark the spot
|
956
|
+
CLI 0(R5),C')' End bracket?
|
957
|
+
BC B'1000',QM_0123 ... yes, continue process
|
958
|
+
CLI 0(R5),X'F0' Compare TTL byte to zero
|
959
|
+
BC B'0100',ER_40006 ... when less, syntax error
|
960
|
+
CLI 0(R5),X'FA' Compare TTL byte to FA+
|
961
|
+
BC B'1010',ER_40006 ... when more, syntax error
|
962
|
+
C R1,=F'5' Maximum TTL length?
|
963
|
+
BC B'0010',ER_40006 ... yes, syntax error
|
964
|
+
*
|
965
|
+
LA R1,1(,R1) Increment TTL length
|
966
|
+
LA R5,1(,R5) Point to next byte
|
967
|
+
BCT R4,QM_0122 Continue parsing
|
968
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
969
|
+
***********************************************************************
|
970
|
+
* Issue PUT CONTAINER for TTL field *
|
971
|
+
***********************************************************************
|
972
|
+
QM_0123 DS 0H
|
973
|
+
LA R0,QM_0123 Mark the spot
|
974
|
+
LA R5,1(,R5) Point to next byte
|
975
|
+
S R4,=F'01' Adjust remaining length
|
976
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
977
|
+
*
|
978
|
+
CLI 0(R5),C')' Close parenthesis?
|
979
|
+
BC B'0111',ER_40006 ... no, syntax error
|
980
|
+
*
|
981
|
+
MVI W_TTL,C'Y' Mark TTL command complete
|
982
|
+
*
|
983
|
+
MVC W_NAME,C_TTL Move TTL container name
|
984
|
+
ST R1,W_LENGTH Save data length
|
985
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
986
|
+
*
|
987
|
+
LA R0,QM_0123 Mark the spot
|
988
|
+
LA R5,1(,R5) Point to next byte
|
989
|
+
S R4,=F'01' Adjust remaining length
|
990
|
+
BC B'1000',QM_0500 When zero, parsing complete
|
991
|
+
*
|
992
|
+
CLI 0(R5),C',' Comma?
|
993
|
+
BC B'0111',ER_40006 ... no, syntax error
|
994
|
+
*
|
995
|
+
LA R5,1(,R5) Point to next byte
|
996
|
+
S R4,=F'01' Adjust remaining length
|
997
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
998
|
+
BC B'1111',QM_0110 Continue POST parsing
|
999
|
+
***********************************************************************
|
1000
|
+
* FIELDS command *
|
1001
|
+
***********************************************************************
|
1002
|
+
QM_0130 DS 0H
|
1003
|
+
CLI W_FIELDS,C'Y' FIELDS command performed?
|
1004
|
+
BC B'1000',ER_40006 ... yes, syntax error
|
1005
|
+
*
|
1006
|
+
LA R5,6(,R5) Point past command
|
1007
|
+
S R4,=F'06' Adjust remaining length
|
1008
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
1009
|
+
***********************************************************************
|
1010
|
+
* Begin parsing FIELDS command *
|
1011
|
+
***********************************************************************
|
1012
|
+
QM_0131 DS 0H
|
1013
|
+
LA R0,QM_0131 Mark the spot
|
1014
|
+
CLI 0(R5),C'(' Begin bracket?
|
1015
|
+
BC B'0111',ER_40006 ... no, syntax error
|
1016
|
+
LA R5,1(,R5) Point to next byte
|
1017
|
+
S R4,=F'01' Adjust remaining length
|
1018
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
1019
|
+
*
|
1020
|
+
XR R1,R1 Clear R1 (counter)
|
1021
|
+
ST R5,W_ADDR Save beginning address
|
1022
|
+
LR R15,R5 Load beginning address
|
1023
|
+
***********************************************************************
|
1024
|
+
* Determine field name length. *
|
1025
|
+
***********************************************************************
|
1026
|
+
QM_0132 DS 0H
|
1027
|
+
LA R0,QM_0132 Mark the spot
|
1028
|
+
CLI 0(R5),C'=' Equal sign?
|
1029
|
+
BC B'1000',QM_0133 ... yes, process
|
1030
|
+
C R1,=F'16' Exceed maximum field length?
|
1031
|
+
BC B'0011',ER_40006 ... yes, syntax error
|
1032
|
+
LA R1,1(,R1) Increment field name length
|
1033
|
+
LA R5,1(,R5) Point to next byte
|
1034
|
+
BCT R4,QM_0132 Continue evaluation
|
1035
|
+
BC B'1111',ER_40006 EOF, syntax error
|
1036
|
+
***********************************************************************
|
1037
|
+
* Address FAxxFD table *
|
1038
|
+
***********************************************************************
|
1039
|
+
QM_0133 DS 0H
|
1040
|
+
LA R0,QM_0133 Mark the spot
|
1041
|
+
LA R5,1(,R5) Point to next byte
|
1042
|
+
S R4,=F'01' Adjust remaining length
|
1043
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
1044
|
+
*
|
1045
|
+
L R9,FD_GM Load FAxxFD address
|
1046
|
+
USING FD_DSECT,R9 ... tell assembler
|
1047
|
+
L R7,FD_LEN Load FD table length
|
1048
|
+
LA R6,E_FD Load FD entry length
|
1049
|
+
S R1,ONE Adjust before EX command
|
1050
|
+
***********************************************************************
|
1051
|
+
* Verify the field name is in FAxxFD *
|
1052
|
+
***********************************************************************
|
1053
|
+
QM_0134 DS 0H
|
1054
|
+
LA R0,QM_0134 Mark the spot
|
1055
|
+
LA R14,F_NAME Point to field name
|
1056
|
+
EX R1,CLC_0134 Field name match?
|
1057
|
+
BC B'1000',QM_0135 ... yes, process
|
1058
|
+
LA R9,0(R6,R9) Point to next FD entry
|
1059
|
+
SR R7,R6 Reduce total length by an entry
|
1060
|
+
BC B'0010',QM_0134 Continue search
|
1061
|
+
MVC C_FIELD,HEX_40 Move spaces to field name
|
1062
|
+
LA R14,C_FIELD Point to field name
|
1063
|
+
EX R1,MVC_0134 Move field name to diagnostics
|
1064
|
+
BC B'1111',ER_41201 ... EOF, syntax error
|
1065
|
+
CLC_0134 CLC 0(0,R14),0(R15) Check field name
|
1066
|
+
MVC_0134 MVC 0(0,R14),0(R15) Move field name
|
1067
|
+
***********************************************************************
|
1068
|
+
* Move field name to parser array *
|
1069
|
+
***********************************************************************
|
1070
|
+
QM_0135 DS 0H
|
1071
|
+
LA R0,QM_0135 Mark the spot
|
1072
|
+
MVC W_NAME,HEX_40 Clear field
|
1073
|
+
LA R14,W_NAME Point to field name
|
1074
|
+
EX R1,MVC_0135 Set container name
|
1075
|
+
L R8,PA_GM Load parser array address
|
1076
|
+
USING PA_DSECT,R8 ... tell assembler
|
1077
|
+
*
|
1078
|
+
LA R7,E_PA Load parser array entry length
|
1079
|
+
XR R6,R6 Clear even register
|
1080
|
+
L R1,W_INDEX Load PA index
|
1081
|
+
MR R6,R1 Multiply by entry length
|
1082
|
+
LA R8,0(R7,R8) Point to current PA entry
|
1083
|
+
*
|
1084
|
+
LA R1,1(,R1) Increment PA index
|
1085
|
+
ST R1,W_INDEX Save PA index
|
1086
|
+
C R1,MAX_PA PA index exceeded?
|
1087
|
+
BC B'0010',ER_41403 ... yes, STATUS(414)
|
1088
|
+
*
|
1089
|
+
MVC P_NAME,F_NAME Move field name to PA
|
1090
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
1091
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
1092
|
+
PACK P_ID,F_ID Pack field ID to PA
|
1093
|
+
PACK P_COL,F_COL Pack field column to PA
|
1094
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
1095
|
+
*
|
1096
|
+
XR R1,R1 Clear R1
|
1097
|
+
ST R5,W_ADDR Save field data address
|
1098
|
+
BC B'1111',QM_0136 Determine field length
|
1099
|
+
*
|
1100
|
+
MVC_0135 MVC 0(0,R14),0(R15) Set container name
|
1101
|
+
***********************************************************************
|
1102
|
+
* Determine length of data for this field *
|
1103
|
+
***********************************************************************
|
1104
|
+
QM_0136 DS 0H
|
1105
|
+
CLI 0(R5),C')' End bracket?
|
1106
|
+
BC B'1000',QM_0137 ... yes, PUT CONTAINER
|
1107
|
+
LA R5,1(,R5) Point to next byte
|
1108
|
+
LA R1,1(,R1) Increment field length
|
1109
|
+
C R1,MAX_LEN Field length exceed maximum?
|
1110
|
+
BCT R4,QM_0136 Continue parsing
|
1111
|
+
BC B'1111',ER_40006 Syntax error when zero
|
1112
|
+
***********************************************************************
|
1113
|
+
* Issue PUT CONTAINER for this field data *
|
1114
|
+
***********************************************************************
|
1115
|
+
QM_0137 DS 0H
|
1116
|
+
LA R0,QM_0137 Mark the spot
|
1117
|
+
LA R5,1(,R5) Point to next byte
|
1118
|
+
S R4,=F'1' Adjust remaining length
|
1119
|
+
BC B'1100',ER_40006 Syntax error when zero
|
1120
|
+
*
|
1121
|
+
ST R1,W_LENGTH Save data length
|
1122
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
1123
|
+
***********************************************************************
|
1124
|
+
* When Column ID is 001, issue PUT CONTAINER for primary key *
|
1125
|
+
***********************************************************************
|
1126
|
+
CP P_ID,S_ONE_PD Primary Column ID?
|
1127
|
+
BC B'0111',QM_0138 ... no, continue process
|
1128
|
+
MVC W_NAME,C_KEY Move KEY container name
|
1129
|
+
BAS R14,PC_0010 PUT CONTAINER with PRIMARY key
|
1130
|
+
***********************************************************************
|
1131
|
+
* Continue field syntax editing. *
|
1132
|
+
***********************************************************************
|
1133
|
+
QM_0138 DS 0H
|
1134
|
+
LA R0,QM_0138 Mark the spot
|
1135
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1136
|
+
BC B'1000',QM_0139 ... yes, prepare to parse
|
1137
|
+
*
|
1138
|
+
CLI 0(R5),C')' Close Parenthesis?
|
1139
|
+
BC B'0111',ER_40006 ... no, syntax error
|
1140
|
+
*
|
1141
|
+
LA R5,1(,R5) Point to next byte
|
1142
|
+
S R4,=F'1' Adjust remaining length
|
1143
|
+
BC B'1100',QM_0500 When zero, parsing is complete
|
1144
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1145
|
+
BC B'0111',ER_40006 ... no, syntax error
|
1146
|
+
LA R5,1(,R5) Point to next byte
|
1147
|
+
S R4,=F'1' Adjust remaining length
|
1148
|
+
BC B'1100',ER_40006 When zero, syntax error
|
1149
|
+
MVI W_FIELDS,C'Y' Set FIELDS command complete
|
1150
|
+
BC B'1111',QM_0110 Continue parsing
|
1151
|
+
*
|
1152
|
+
***********************************************************************
|
1153
|
+
* Prepare to parse next FIELDS request *
|
1154
|
+
***********************************************************************
|
1155
|
+
QM_0139 DS 0H
|
1156
|
+
LA R0,QM_0139 Mark the spot
|
1157
|
+
LA R5,1(,R5) Point to next byte
|
1158
|
+
S R4,=F'1' Adjust remaining length
|
1159
|
+
BC B'1100',ER_40006 Syntax error when EOQS
|
1160
|
+
BC B'1111',QM_0131 Continue with FIELDS
|
1161
|
+
*
|
1162
|
+
***********************************************************************
|
1163
|
+
* Parse GET request, using Query String *
|
1164
|
+
* Since the WEB EXTRACT command moves the Query String 'into' an area *
|
1165
|
+
* instead of setting a pointer, only a three byte area is defined for *
|
1166
|
+
* the EXTRACT command. The three bytes are used to determine whether *
|
1167
|
+
* the request is basic mode or query mode (zQL). When query mode, *
|
1168
|
+
* parse the DFHCOMMAREA for the beginning of the query string and *
|
1169
|
+
* save the pointer address. This reduces the amount of DFHEISTG *
|
1170
|
+
* storage required for the Query String and eliminates a GETMAIN. *
|
1171
|
+
***********************************************************************
|
1172
|
+
QM_0200 DS 0H
|
1173
|
+
L R9,FD_GM Load FAxxFD address
|
1174
|
+
USING FD_DSECT,R9 ... tell assembler
|
1175
|
+
*
|
1176
|
+
MVC O_P_NAME,F_NAME Move field name to OT
|
1177
|
+
MVC O_P_TYPE,F_TYPE Move field type to OT
|
1178
|
+
PACK O_P_COL,F_COL Pack field column to OT
|
1179
|
+
PACK O_P_LEN,F_LEN Pack field length to OT
|
1180
|
+
*
|
1181
|
+
MVC O_FORM,S_FIXED Set default OPTIONS FORMAT
|
1182
|
+
MVC O_DIST,S_NO Set default OPTIONS DISTINCT
|
1183
|
+
MVC O_MODE,S_ON Set default OPTIONS MODE
|
1184
|
+
MVC O_ROWS,S_ZEROES Set default OPTIONS ROWS
|
1185
|
+
MVC O_SORT,HEX_40 Set default OPTIONS SORT
|
1186
|
+
MVC O_WITH,S_UR Set default OPTIONS WITH
|
1187
|
+
*
|
1188
|
+
BAS R14,TR_0010 Execute Trace entry
|
1189
|
+
*
|
1190
|
+
BAS R14,CA_0010 Parse DFHCOMMAREA for QS
|
1191
|
+
USING DFHCA,R5 ... tell assembler
|
1192
|
+
L R4,L_QUERY Load query string length
|
1193
|
+
LA R5,3(,R5) Skip past the ZQl command
|
1194
|
+
S R4,=F'03' Adjust remaining length
|
1195
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1196
|
+
*
|
1197
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1198
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1199
|
+
LA R5,1(,R5) Point to next byte
|
1200
|
+
S R4,=F'01' Adjust remaining length
|
1201
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1202
|
+
*
|
1203
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
1204
|
+
CLC 0(6,R5),S_SELECT Is this a SELECT command?
|
1205
|
+
BC B'0111',ER_40502 ... no, invalid command
|
1206
|
+
LA R5,6(,R5) Point to next byte
|
1207
|
+
S R4,=F'06' Adjust remaining length
|
1208
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1209
|
+
*
|
1210
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1211
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1212
|
+
LA R5,1(,R5) Point to next byte
|
1213
|
+
S R4,=F'01' Adjust remaining length
|
1214
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1215
|
+
***********************************************************************
|
1216
|
+
* Check GET request for zQL commands. *
|
1217
|
+
* Valid commands are WHERE, WITH, FIELDS, and OPTIONS *
|
1218
|
+
***********************************************************************
|
1219
|
+
QM_0210 DS 0H
|
1220
|
+
LA R0,QM_0210 Mark the spot
|
1221
|
+
CLI 0(R5),C'(' Open parenthesis?
|
1222
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1223
|
+
LA R5,1(,R5) Point to next byte
|
1224
|
+
S R4,=F'01' Adjust remaining length
|
1225
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1226
|
+
*
|
1227
|
+
OC 0(4,R5),HEX_40 Set upper case bits
|
1228
|
+
CLC 0(4,R5),S_WITH Is this a WITH command?
|
1229
|
+
BC B'1000',QM_0220 ... yes, process
|
1230
|
+
*
|
1231
|
+
OC 0(5,R5),HEX_40 Set upper case bits
|
1232
|
+
CLC 0(5,R5),S_WHERE Is this a WHERE command?
|
1233
|
+
BC B'1000',QM_0240 ... yes, process
|
1234
|
+
*
|
1235
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
1236
|
+
CLC 0(6,R5),S_FIELDS Is this a FIELDS command?
|
1237
|
+
BC B'1000',QM_0230 ... yes, process
|
1238
|
+
*
|
1239
|
+
OC 0(7,R5),HEX_40 Set upper case bits
|
1240
|
+
CLC 0(7,R5),S_OPTION Is this an OPTIONS command?
|
1241
|
+
BC B'1000',QM_0250 ... yes, process
|
1242
|
+
BC B'1000',ER_40007 ... no, syntax error
|
1243
|
+
***********************************************************************
|
1244
|
+
* WITH command *
|
1245
|
+
***********************************************************************
|
1246
|
+
QM_0220 DS 0H
|
1247
|
+
LA R0,QM_0220 Mark the spot
|
1248
|
+
CLI W_WITH,C'Y' WITH command performed?
|
1249
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1250
|
+
*
|
1251
|
+
LA R5,4(,R5) Point past command
|
1252
|
+
S R4,=F'04' Adjust remaining length
|
1253
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1254
|
+
*
|
1255
|
+
CLI 0(R5),C'(' Begin bracket?
|
1256
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1257
|
+
LA R5,1(,R5) Point to next byte
|
1258
|
+
S R4,=F'01' Adjust remaining length
|
1259
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1260
|
+
*
|
1261
|
+
OC 0(2,R5),HEX_40 Set upper case bits
|
1262
|
+
CLC 0(2,R5),S_UR Uncommitted read request?
|
1263
|
+
BC B'1000',QM_0221 ... yes, continue
|
1264
|
+
CLC 0(2,R5),S_CR Committed read request?
|
1265
|
+
BC B'1000',QM_0221 ... yes, continue
|
1266
|
+
BC B'1111',ER_40007 ... no, syntax error
|
1267
|
+
***********************************************************************
|
1268
|
+
* Save WITH request and prepare for next parm. *
|
1269
|
+
***********************************************************************
|
1270
|
+
QM_0221 DS 0H
|
1271
|
+
LA R0,QM_0221 Mark the spot
|
1272
|
+
ST R5,W_ADDR Save current pointer address
|
1273
|
+
LA R5,2(,R5) Point to next byte
|
1274
|
+
S R4,=F'02' Adjust remaining length
|
1275
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1276
|
+
*
|
1277
|
+
CLI 0(R5),C')' End bracket?
|
1278
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1279
|
+
LA R5,1(,R5) Point to next byte
|
1280
|
+
S R4,=F'01' Adjust remaining length
|
1281
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1282
|
+
*
|
1283
|
+
CLI 0(R5),C')' Close parenthesis
|
1284
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1285
|
+
*
|
1286
|
+
***********************************************************************
|
1287
|
+
* Move WITH UR/CR to OPTIONS table. *
|
1288
|
+
***********************************************************************
|
1289
|
+
QM_0222 DS 0H
|
1290
|
+
MVI W_WITH,C'Y' Mark WITH command complete
|
1291
|
+
*
|
1292
|
+
L R1,W_ADDR Load WITH address
|
1293
|
+
MVC O_WITH,0(R1) Move WITh parameter
|
1294
|
+
*
|
1295
|
+
LA R0,QM_0222 Mark the spot
|
1296
|
+
LA R5,1(,R5) Point to next byte
|
1297
|
+
S R4,=F'01' Adjust remaining length
|
1298
|
+
BC B'1000',QM_0500 When zero, parsing complete
|
1299
|
+
*
|
1300
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1301
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1302
|
+
LA R5,1(,R5) Point to next byte
|
1303
|
+
S R4,=F'1' Adjust remaining length
|
1304
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1305
|
+
BC B'1111',QM_0210 Continue parsing
|
1306
|
+
***********************************************************************
|
1307
|
+
* FIELDS command *
|
1308
|
+
***********************************************************************
|
1309
|
+
QM_0230 DS 0H
|
1310
|
+
LA R0,QM_0230 Mark the spot
|
1311
|
+
CLI W_FIELDS,C'Y' FIELDS command performed?
|
1312
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1313
|
+
*
|
1314
|
+
LA R5,6(,R5) Point past command
|
1315
|
+
S R4,=F'06' Adjust remaining length
|
1316
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1317
|
+
***********************************************************************
|
1318
|
+
* Begin parsing FIELDS command *
|
1319
|
+
***********************************************************************
|
1320
|
+
QM_0231 DS 0H
|
1321
|
+
LA R0,QM_0231 Mark the spot
|
1322
|
+
CLI 0(R5),C'(' Begin bracket?
|
1323
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1324
|
+
LA R5,1(,R5) Point to next byte
|
1325
|
+
S R4,=F'01' Adjust remaining length
|
1326
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1327
|
+
*
|
1328
|
+
XR R1,R1 Clear R1 (counter)
|
1329
|
+
ST R5,W_ADDR Save beginning address
|
1330
|
+
LR R15,R5 Load beginning address
|
1331
|
+
***********************************************************************
|
1332
|
+
* Determine field name length. *
|
1333
|
+
***********************************************************************
|
1334
|
+
QM_0232 DS 0H
|
1335
|
+
LA R0,QM_0232 Mark the spot
|
1336
|
+
CLI 0(R5),C')' End bracket?
|
1337
|
+
BC B'1000',QM_0233 ... yes, process
|
1338
|
+
C R1,=F'16' Exceed maximum field length?
|
1339
|
+
BC B'0011',ER_40007 ... yes, syntax error
|
1340
|
+
LA R1,1(,R1) Increment field name length
|
1341
|
+
LA R5,1(,R5) Point to next byte
|
1342
|
+
BCT R4,QM_0232 Continue evaluation
|
1343
|
+
BC B'1111',ER_40007 EOF, syntax error
|
1344
|
+
***********************************************************************
|
1345
|
+
* Address FAxxFD table *
|
1346
|
+
***********************************************************************
|
1347
|
+
QM_0233 DS 0H
|
1348
|
+
LA R0,QM_0233 Mark the spot
|
1349
|
+
LA R5,1(,R5) Point to next byte
|
1350
|
+
S R4,=F'1' Adjust remaining length
|
1351
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1352
|
+
*
|
1353
|
+
L R9,FD_GM Load FAxxFD address
|
1354
|
+
USING FD_DSECT,R9 ... tell assembler
|
1355
|
+
L R7,FD_LEN Load FD table length
|
1356
|
+
LA R6,E_FD Load FD entry length
|
1357
|
+
S R1,ONE Adjust before EX command
|
1358
|
+
***********************************************************************
|
1359
|
+
* Verify the field name is in FAxxFD *
|
1360
|
+
***********************************************************************
|
1361
|
+
QM_0234 DS 0H
|
1362
|
+
LA R0,QM_0234 Mark the spot
|
1363
|
+
LA R14,F_NAME Point to field name
|
1364
|
+
EX R1,CLC_0234 Field name match?
|
1365
|
+
BC B'1000',QM_0235 ... yes, process
|
1366
|
+
LA R9,0(R6,R9) Point to next FD entry
|
1367
|
+
SR R7,R6 Reduce total length by an entry
|
1368
|
+
BC B'0010',QM_0234 Continue search
|
1369
|
+
MVC C_FIELD,HEX_40 Move spaces to field name
|
1370
|
+
LA R14,C_FIELD Point to field name
|
1371
|
+
EX R1,MVC_0234 Move field name to diagnostics
|
1372
|
+
BC B'1111',ER_41202 ... EOF, syntax error
|
1373
|
+
CLC_0234 CLC 0(0,R14),0(R15) Check field name
|
1374
|
+
MVC_0234 MVC 0(0,R14),0(R15) Move field name
|
1375
|
+
*
|
1376
|
+
***********************************************************************
|
1377
|
+
* Move field name to parser array *
|
1378
|
+
***********************************************************************
|
1379
|
+
QM_0235 DS 0H
|
1380
|
+
LA R0,QM_0235 Mark the spot
|
1381
|
+
MVC W_NAME,HEX_40 Clear field
|
1382
|
+
LA R14,W_NAME Point to field name
|
1383
|
+
EX R1,MVC_0235 Set container name
|
1384
|
+
*
|
1385
|
+
L R8,PA_GM Load parser array address
|
1386
|
+
USING PA_DSECT,R8 ... tell assembler
|
1387
|
+
*
|
1388
|
+
LA R7,E_PA Load parser array entry length
|
1389
|
+
XR R6,R6 Clear even register
|
1390
|
+
L R1,W_INDEX Load PA index
|
1391
|
+
MR R6,R1 Multiply by entry length
|
1392
|
+
LA R8,0(R7,R8) Point to current PA entry
|
1393
|
+
*
|
1394
|
+
LA R1,1(,R1) Increment PA index
|
1395
|
+
ST R1,W_INDEX Save PA index
|
1396
|
+
C R1,MAX_PA PA index exceeded?
|
1397
|
+
BC B'0010',ER_41404 ... yes, STATUS(414)
|
1398
|
+
*
|
1399
|
+
MVI P_WHERE,C'N' Move WHERE indicator (no)
|
1400
|
+
MVC P_NAME,F_NAME Move field name to PA
|
1401
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
1402
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
1403
|
+
PACK P_ID,F_ID Pack field ID to PA
|
1404
|
+
PACK P_COL,F_COL Pack field column to PA
|
1405
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
1406
|
+
*
|
1407
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1408
|
+
BC B'1000',QM_0236 ... yes, prepare to parse
|
1409
|
+
*
|
1410
|
+
CLI 0(R5),C')' Close Parenthesis?
|
1411
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1412
|
+
*
|
1413
|
+
LA R5,1(,R5) Point to next byte
|
1414
|
+
S R4,=F'1' Adjust remaining length
|
1415
|
+
BC B'1100',QM_0500 When zero, parsing is complete
|
1416
|
+
CLI 0(R5),C',' Is next byte a comma?
|
1417
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1418
|
+
LA R5,1(,R5) Point to next byte
|
1419
|
+
S R4,=F'1' Adjust remaining length
|
1420
|
+
BC B'1100',ER_40007 When zero, syntax error
|
1421
|
+
MVI W_FIELDS,C'Y' Set FIELDS command complete
|
1422
|
+
BC B'1111',QM_0210 Continue parsing
|
1423
|
+
*
|
1424
|
+
MVC_0235 MVC 0(0,R14),0(R15) Set container name
|
1425
|
+
***********************************************************************
|
1426
|
+
* Prepare to parse next FIELDS request *
|
1427
|
+
***********************************************************************
|
1428
|
+
QM_0236 DS 0H
|
1429
|
+
LA R0,QM_0236 Mark the spot
|
1430
|
+
LA R5,1(,R5) Point to next byte
|
1431
|
+
S R4,=F'1' Adjust remaining length
|
1432
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1433
|
+
BC B'1111',QM_0231 Continue with FIELDS
|
1434
|
+
***********************************************************************
|
1435
|
+
* WHERE command *
|
1436
|
+
***********************************************************************
|
1437
|
+
QM_0240 DS 0H
|
1438
|
+
CLI W_WHERE,C'Y' WHERE command performed?
|
1439
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1440
|
+
*
|
1441
|
+
LA R5,5(,R5) Point past command
|
1442
|
+
S R4,=F'05' Adjust remaining length
|
1443
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1444
|
+
***********************************************************************
|
1445
|
+
* Begin parsing WHERE command *
|
1446
|
+
***********************************************************************
|
1447
|
+
QM_0241 DS 0H
|
1448
|
+
LA R0,QM_0241 Mark the spot
|
1449
|
+
CLI 0(R5),C'(' Begin bracket?
|
1450
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1451
|
+
LA R5,1(,R5) Point to next byte
|
1452
|
+
S R4,=F'01' Adjust remaining length
|
1453
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1454
|
+
*
|
1455
|
+
XR R1,R1 Clear R1 (counter)
|
1456
|
+
ST R5,W_ADDR Save beginning address
|
1457
|
+
LR R15,R5 Load beginning address
|
1458
|
+
***********************************************************************
|
1459
|
+
* Determine field name length. *
|
1460
|
+
***********************************************************************
|
1461
|
+
QM_0242 DS 0H
|
1462
|
+
LA R0,QM_0242 Mark the spot
|
1463
|
+
CLI 0(R5),C'=' Equal sign (end of field)?
|
1464
|
+
BC B'1000',QM_0243 ... yes, process
|
1465
|
+
*
|
1466
|
+
CLI 0(R5),C'>' Greater Than sign (EOF)?
|
1467
|
+
BC B'1000',QM_0243 ... yes, process
|
1468
|
+
*
|
1469
|
+
CLI 0(R5),C'+' GTEQ sign (EOF)?
|
1470
|
+
BC B'1000',QM_0243 ... yes, process
|
1471
|
+
*
|
1472
|
+
C R1,=F'16' Exceed maximum field length?
|
1473
|
+
BC B'0011',ER_40007 ... yes, syntax error
|
1474
|
+
LA R1,1(,R1) Increment field name length
|
1475
|
+
LA R5,1(,R5) Point to next byte
|
1476
|
+
BCT R4,QM_0242 Continue evaluation
|
1477
|
+
BC B'1111',ER_40007 EOF, syntax error
|
1478
|
+
***********************************************************************
|
1479
|
+
* Address FAxxFD table *
|
1480
|
+
***********************************************************************
|
1481
|
+
QM_0243 DS 0H
|
1482
|
+
MVC W_SIGN,0(R5) Move type of sign (= > +)
|
1483
|
+
LA R0,QM_0243 Mark the spot
|
1484
|
+
LA R5,1(,R5) Point to next byte
|
1485
|
+
S R4,=F'01' Adjust remaining length
|
1486
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1487
|
+
*
|
1488
|
+
L R9,FD_GM Load FAxxFD address
|
1489
|
+
USING FD_DSECT,R9 ... tell assembler
|
1490
|
+
L R7,FD_LEN Load FD table length
|
1491
|
+
LA R6,E_FD Load FD entry length
|
1492
|
+
S R1,ONE Adjust before EX command
|
1493
|
+
***********************************************************************
|
1494
|
+
* Verify the field name is in FAxxFD *
|
1495
|
+
***********************************************************************
|
1496
|
+
QM_0244 DS 0H
|
1497
|
+
LA R0,QM_0244 Mark the spot
|
1498
|
+
LA R14,F_NAME Point to field name
|
1499
|
+
EX R1,CLC_0244 Field name match?
|
1500
|
+
BC B'1000',QM_0245 ... yes, process
|
1501
|
+
LA R9,0(R6,R9) Point to next FD entry
|
1502
|
+
SR R7,R6 Reduce total length by an entry
|
1503
|
+
BC B'0010',QM_0244 Continue search
|
1504
|
+
BC B'1111',ER_40007 EOF, syntax error
|
1505
|
+
CLC_0244 CLC 0(0,R14),0(R15) Check field name
|
1506
|
+
***********************************************************************
|
1507
|
+
* Move field name to parser array *
|
1508
|
+
***********************************************************************
|
1509
|
+
QM_0245 DS 0H
|
1510
|
+
LA R0,QM_0245 Mark the spot
|
1511
|
+
MVC W_NAME,HEX_40 Clear field
|
1512
|
+
LA R14,W_NAME Point to field name
|
1513
|
+
EX R1,MVC_0245 Set container name
|
1514
|
+
*
|
1515
|
+
L R8,PA_GM Load parser array address
|
1516
|
+
USING PA_DSECT,R8 ... tell assembler
|
1517
|
+
*
|
1518
|
+
LA R7,E_PA Load parser array entry length
|
1519
|
+
XR R6,R6 Clear even register
|
1520
|
+
L R1,W_INDEX Load PA index
|
1521
|
+
MR R6,R1 Multiply by entry length
|
1522
|
+
LA R8,0(R7,R8) Point to current PA entry
|
1523
|
+
*
|
1524
|
+
LA R1,1(,R1) Increment PA index
|
1525
|
+
ST R1,W_INDEX Save PA index
|
1526
|
+
C R1,MAX_PA PA index exceeded?
|
1527
|
+
BC B'0010',ER_41405 ... yes, STATUS(414)
|
1528
|
+
*
|
1529
|
+
* MVI P_WHERE,C'Y' Move WHERE indicator
|
1530
|
+
MVC P_WHERE,W_SIGN Move WHERE sign to PA
|
1531
|
+
*
|
1532
|
+
MVC P_NAME,F_NAME Move field name to PA
|
1533
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
1534
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
1535
|
+
PACK P_ID,F_ID Pack field ID to PA
|
1536
|
+
PACK P_COL,F_COL Pack field column to PA
|
1537
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
1538
|
+
*
|
1539
|
+
XR R1,R1 Clear R1
|
1540
|
+
ST R5,W_ADDR Save field data address
|
1541
|
+
BC B'1111',QM_0246 Determine field length
|
1542
|
+
MVC_0245 MVC 0(0,R14),0(R15) Set container name
|
1543
|
+
***********************************************************************
|
1544
|
+
* Determine length of data for this field *
|
1545
|
+
***********************************************************************
|
1546
|
+
QM_0246 DS 0H
|
1547
|
+
LA R0,QM_0246 Mark the spot
|
1548
|
+
CLI 0(R5),C')' End bracket?
|
1549
|
+
BC B'1000',QM_0247 ... yes, PUT CONTAINER
|
1550
|
+
LA R5,1(,R5) Point to next byte
|
1551
|
+
LA R1,1(,R1) Increment field length
|
1552
|
+
C R1,MAX_LEN Field length exceed maximum?
|
1553
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1554
|
+
BCT R4,QM_0246 Continue parsing
|
1555
|
+
BC B'1111',ER_40007 Syntax error when zero
|
1556
|
+
***********************************************************************
|
1557
|
+
* Issue PUT CONTAINER for field data *
|
1558
|
+
***********************************************************************
|
1559
|
+
QM_0247 DS 0H
|
1560
|
+
LA R0,QM_0247 Mark the spot
|
1561
|
+
LA R5,1(,R5) Point to next byte
|
1562
|
+
S R4,=F'01' Adjust remaining length
|
1563
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1564
|
+
*
|
1565
|
+
ST R1,W_LENGTH Save field length
|
1566
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
1567
|
+
*
|
1568
|
+
LA R0,QM_0247 Mark the spot
|
1569
|
+
*
|
1570
|
+
CLC 0(3,R5),S_AND AND clause?
|
1571
|
+
BC B'1000',QM_0248 ... yes, adjust address/length
|
1572
|
+
*
|
1573
|
+
CLI 0(R5),C',' Is this byte a comma?
|
1574
|
+
BC B'1000',QM_0249 ... yes, adjust address/length
|
1575
|
+
*
|
1576
|
+
CLI 0(R5),C')' Close parenthesis?
|
1577
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1578
|
+
*
|
1579
|
+
LA R5,1(,R5) Point to next byte
|
1580
|
+
S R4,=F'1' Adjust remaining length
|
1581
|
+
BC B'1100',QM_0500 When zero, parsing is complete
|
1582
|
+
CLI 0(R5),C',' Is the next byte a comma?
|
1583
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1584
|
+
LA R5,1(,R5) Point to next byte
|
1585
|
+
S R4,=F'1' Adjust remaining length
|
1586
|
+
BC B'1100',ER_40007 When zero, sytax error
|
1587
|
+
MVI W_WHERE,C'Y' Set WHERE command complete
|
1588
|
+
BC B'1111',QM_0210 Continue parsing
|
1589
|
+
*
|
1590
|
+
***********************************************************************
|
1591
|
+
* AND clause on WHERE statement *
|
1592
|
+
***********************************************************************
|
1593
|
+
QM_0248 DS 0H
|
1594
|
+
LA R0,QM_0248 Mark the spot
|
1595
|
+
LA R5,3(,R5) Point to past AND
|
1596
|
+
S R4,=F'3' Adjust remaining length
|
1597
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1598
|
+
BC B'1111',QM_0241 Continue WHERE parsing
|
1599
|
+
***********************************************************************
|
1600
|
+
* Comma between WHERE statements *
|
1601
|
+
***********************************************************************
|
1602
|
+
QM_0249 DS 0H
|
1603
|
+
LA R0,QM_0249 Mark the spot
|
1604
|
+
LA R5,1(,R5) Point to past AND
|
1605
|
+
S R4,=F'1' Adjust remaining length
|
1606
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1607
|
+
BC B'1111',QM_0241 Continue WHERE parsing
|
1608
|
+
***********************************************************************
|
1609
|
+
* OPTIONS command *
|
1610
|
+
***********************************************************************
|
1611
|
+
QM_0250 DS 0H
|
1612
|
+
CLI W_OPTION,C'Y' OPTIONS command performed?
|
1613
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1614
|
+
*
|
1615
|
+
LA R5,7(,R5) Point past command
|
1616
|
+
S R4,=F'07' Adjust remaining length
|
1617
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1618
|
+
***********************************************************************
|
1619
|
+
* Begin parsing OPTIONS command *
|
1620
|
+
* Valid parameters are FORMAT, DISTINCT, MODE, SORT and ROWS. *
|
1621
|
+
***********************************************************************
|
1622
|
+
QM_0251 DS 0H
|
1623
|
+
LA R0,QM_0251 Mark the spot
|
1624
|
+
CLI 0(R5),C'(' Begin bracket?
|
1625
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1626
|
+
LA R5,1(,R5) Point to next byte
|
1627
|
+
S R4,=F'01' Adjust remaining length
|
1628
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1629
|
+
*
|
1630
|
+
CLC 0(6,R5),S_FORMAT Is this a FORMAT parm?
|
1631
|
+
BC B'1000',QM_0252 ... yes, process
|
1632
|
+
CLC 0(8,R5),S_DIST Is this a DISTINCT parm?
|
1633
|
+
BC B'1000',QM_0253 ... yes, process
|
1634
|
+
CLC 0(4,R5),S_MODE Is this a MODE parm?
|
1635
|
+
BC B'1000',QM_0254 ... yes, process
|
1636
|
+
CLC 0(4,R5),S_SORT Is this a SORT parm?
|
1637
|
+
BC B'1000',QM_0255 ... yes, process
|
1638
|
+
CLC 0(4,R5),S_ROWS Is this a ROWS parm?
|
1639
|
+
BC B'1000',QM_0256 ... yes, process
|
1640
|
+
BC B'1111',ER_40007 ... no, syntax error
|
1641
|
+
*
|
1642
|
+
***********************************************************************
|
1643
|
+
* FORMAT parameter specified. *
|
1644
|
+
***********************************************************************
|
1645
|
+
QM_0252 DS 0H
|
1646
|
+
LA R0,QM_0252 Mark the spot
|
1647
|
+
CLI W_FORM,C'Y' FORMAT parm performed?
|
1648
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1649
|
+
*
|
1650
|
+
LA R5,6(,R5) Point past command
|
1651
|
+
S R4,=F'06' Adjust remaining length
|
1652
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1653
|
+
*
|
1654
|
+
CLI 0(R5),C'=' Equal sign?
|
1655
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1656
|
+
LA R5,1(,R5) Point to next byte
|
1657
|
+
S R4,=F'01' Adjust remaining length
|
1658
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1659
|
+
*
|
1660
|
+
CLC 0(5,R5),S_FIXED FIXED format?
|
1661
|
+
BC B'1000',QM_0252A ... yes, continue
|
1662
|
+
CLC 0(3,R5),S_XML XML format?
|
1663
|
+
BC B'1000',QM_0252B ... yes, continue
|
1664
|
+
CLC 0(4,R5),S_JSON JSON format?
|
1665
|
+
BC B'1000',QM_0252C ... yes, continue
|
1666
|
+
CLC 0(9,R5),S_DELIM DELIMITER format?
|
1667
|
+
BC B'1000',QM_0252D ... yes, continue
|
1668
|
+
*
|
1669
|
+
BC B'1111',ER_40007 ... no, syntax error
|
1670
|
+
***********************************************************************
|
1671
|
+
* Move FIXED format parameter to OPTIONS table *
|
1672
|
+
***********************************************************************
|
1673
|
+
QM_0252A DS 0H
|
1674
|
+
LA R0,QM_0252A Mark the spot
|
1675
|
+
ST R5,W_ADDR Save current pointer address
|
1676
|
+
LA R5,5(,R5) Point to next byte
|
1677
|
+
S R4,=F'05' Adjust remaining length
|
1678
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1679
|
+
CLI 0(R5),C')' End bracket?
|
1680
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1681
|
+
*
|
1682
|
+
LA R5,1(,R5) Point to next byte
|
1683
|
+
S R4,=F'01' Adjust remaining length
|
1684
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1685
|
+
*
|
1686
|
+
MVI W_FORM,C'Y' Mark FORMAT parm complete
|
1687
|
+
MVC O_FORM,S_FIXED Move FIXED parm
|
1688
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1689
|
+
*
|
1690
|
+
***********************************************************************
|
1691
|
+
* Move XML format parameter to OPTIONS table *
|
1692
|
+
***********************************************************************
|
1693
|
+
QM_0252B DS 0H
|
1694
|
+
LA R0,QM_0252B Mark the spot
|
1695
|
+
ST R5,W_ADDR Save current pointer address
|
1696
|
+
LA R5,3(,R5) Point to next byte
|
1697
|
+
S R4,=F'03' Adjust remaining length
|
1698
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1699
|
+
CLI 0(R5),C')' End bracket?
|
1700
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1701
|
+
*
|
1702
|
+
LA R5,1(,R5) Point to next byte
|
1703
|
+
S R4,=F'01' Adjust remaining length
|
1704
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1705
|
+
*
|
1706
|
+
MVI W_FORM,C'Y' Mark FORMAT parm complete
|
1707
|
+
MVC O_FORM,S_XML Move XML parm
|
1708
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1709
|
+
*
|
1710
|
+
***********************************************************************
|
1711
|
+
* Move JSON format parameter to OPTIONS table *
|
1712
|
+
***********************************************************************
|
1713
|
+
QM_0252C DS 0H
|
1714
|
+
LA R0,QM_0252C Mark the spot
|
1715
|
+
ST R5,W_ADDR Save current pointer address
|
1716
|
+
LA R5,4(,R5) Point to next byte
|
1717
|
+
S R4,=F'04' Adjust remaining length
|
1718
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1719
|
+
CLI 0(R5),C')' End bracket?
|
1720
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1721
|
+
*
|
1722
|
+
LA R5,1(,R5) Point to next byte
|
1723
|
+
S R4,=F'01' Adjust remaining length
|
1724
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1725
|
+
*
|
1726
|
+
MVI W_FORM,C'Y' Mark FORMAT parm complete
|
1727
|
+
MVC O_FORM,S_JSON Move JSON parm
|
1728
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1729
|
+
*
|
1730
|
+
***********************************************************************
|
1731
|
+
* Move DELIMITER format parameter to OPTIONS table *
|
1732
|
+
***********************************************************************
|
1733
|
+
QM_0252D DS 0H
|
1734
|
+
LA R0,QM_0252D Mark the spot
|
1735
|
+
ST R5,W_ADDR Save current pointer address
|
1736
|
+
LA R5,9(,R5) Point to next byte
|
1737
|
+
S R4,=F'09' Adjust remaining length
|
1738
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1739
|
+
CLI 0(R5),C')' End bracket?
|
1740
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1741
|
+
*
|
1742
|
+
LA R5,1(,R5) Point to next byte
|
1743
|
+
S R4,=F'01' Adjust remaining length
|
1744
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1745
|
+
*
|
1746
|
+
MVI W_FORM,C'Y' Mark FORMAT parm complete
|
1747
|
+
MVC O_FORM,S_DELIM Move DELIMITER parm
|
1748
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1749
|
+
*
|
1750
|
+
***********************************************************************
|
1751
|
+
* DISTINCT parameter specified. *
|
1752
|
+
***********************************************************************
|
1753
|
+
QM_0253 DS 0H
|
1754
|
+
LA R0,QM_0253 Mark the spot
|
1755
|
+
CLI W_DIST,C'Y' DISTINCT parm performed?
|
1756
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1757
|
+
*
|
1758
|
+
LA R5,8(,R5) Point past command
|
1759
|
+
S R4,=F'08' Adjust remaining length
|
1760
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1761
|
+
*
|
1762
|
+
CLI 0(R5),C'=' Equal sign?
|
1763
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1764
|
+
LA R5,1(,R5) Point to next byte
|
1765
|
+
S R4,=F'01' Adjust remaining length
|
1766
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1767
|
+
*
|
1768
|
+
CLC 0(3,R5),S_YES DISTINCT=YES?
|
1769
|
+
BC B'1000',QM_0253A ... yes, continue
|
1770
|
+
CLC 0(2,R5),S_NO DISTINCT=NO?
|
1771
|
+
BC B'1000',QM_0253B ... yes, continue
|
1772
|
+
*
|
1773
|
+
BC B'1111',ER_40007 ... no, syntax error
|
1774
|
+
***********************************************************************
|
1775
|
+
* Move DISTINCT=YES to OPTIONS table *
|
1776
|
+
***********************************************************************
|
1777
|
+
QM_0253A DS 0H
|
1778
|
+
LA R0,QM_0253A Mark the spot
|
1779
|
+
ST R5,W_ADDR Save current pointer address
|
1780
|
+
LA R5,3(,R5) Point to next byte
|
1781
|
+
S R4,=F'03' Adjust remaining length
|
1782
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1783
|
+
CLI 0(R5),C')' End bracket?
|
1784
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1785
|
+
*
|
1786
|
+
LA R5,1(,R5) Point to next byte
|
1787
|
+
S R4,=F'01' Adjust remaining length
|
1788
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1789
|
+
*
|
1790
|
+
MVI W_DIST,C'Y' Mark DISTINCT parm complete
|
1791
|
+
MVC O_DIST,S_YES Move DISTINCT=YES
|
1792
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1793
|
+
***********************************************************************
|
1794
|
+
* Move DISTINCT=NO to OPTIONS table *
|
1795
|
+
***********************************************************************
|
1796
|
+
QM_0253B DS 0H
|
1797
|
+
LA R0,QM_0253B Mark the spot
|
1798
|
+
ST R5,W_ADDR Save current pointer address
|
1799
|
+
LA R5,2(,R5) Point to next byte
|
1800
|
+
S R4,=F'02' Adjust remaining length
|
1801
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1802
|
+
CLI 0(R5),C')' End bracket?
|
1803
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1804
|
+
*
|
1805
|
+
LA R5,1(,R5) Point to next byte
|
1806
|
+
S R4,=F'01' Adjust remaining length
|
1807
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1808
|
+
*
|
1809
|
+
MVI W_DIST,C'Y' Mark DISTINCT parm complete
|
1810
|
+
MVC O_DIST,S_NO Move DISTINCT=NO
|
1811
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1812
|
+
***********************************************************************
|
1813
|
+
* MODE parameter specified. *
|
1814
|
+
***********************************************************************
|
1815
|
+
QM_0254 DS 0H
|
1816
|
+
LA R0,QM_0254 Mark the spot
|
1817
|
+
CLI W_MODE,C'Y' MODE parm performed?
|
1818
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1819
|
+
*
|
1820
|
+
LA R5,4(,R5) Point past command
|
1821
|
+
S R4,=F'04' Adjust remaining length
|
1822
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1823
|
+
*
|
1824
|
+
CLI 0(R5),C'=' Equal sign?
|
1825
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1826
|
+
LA R5,1(,R5) Point to next byte
|
1827
|
+
S R4,=F'01' Adjust remaining length
|
1828
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1829
|
+
*
|
1830
|
+
CLC 0(6,R5),S_ON MODE=ONLINE?
|
1831
|
+
BC B'1000',QM_0254A ... yes, continue
|
1832
|
+
CLC 0(7,R5),S_OFF MODE=OFFLINE?
|
1833
|
+
BC B'1000',QM_0254B ... yes, continue
|
1834
|
+
*
|
1835
|
+
BC B'1111',ER_40007 ... no, syntax error
|
1836
|
+
***********************************************************************
|
1837
|
+
* Move MODE=ONLINE to OPTIONS table *
|
1838
|
+
***********************************************************************
|
1839
|
+
QM_0254A DS 0H
|
1840
|
+
LA R0,QM_0254A Mark the spot
|
1841
|
+
ST R5,W_ADDR Save current pointer address
|
1842
|
+
LA R5,6(,R5) Point to next byte
|
1843
|
+
S R4,=F'06' Adjust remaining length
|
1844
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1845
|
+
CLI 0(R5),C')' End bracket?
|
1846
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1847
|
+
*
|
1848
|
+
LA R5,1(,R5) Point to next byte
|
1849
|
+
S R4,=F'01' Adjust remaining length
|
1850
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1851
|
+
*
|
1852
|
+
MVI W_MODE,C'Y' Mark MODE parm complete
|
1853
|
+
MVC O_MODE,S_ON Move MODE=ONLINE
|
1854
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1855
|
+
***********************************************************************
|
1856
|
+
* Move MODE=OFLINE to OPTIONS table *
|
1857
|
+
***********************************************************************
|
1858
|
+
QM_0254B DS 0H
|
1859
|
+
LA R0,QM_0254B Mark the spot
|
1860
|
+
ST R5,W_ADDR Save current pointer address
|
1861
|
+
LA R5,7(,R5) Point to next byte
|
1862
|
+
S R4,=F'07' Adjust remaining length
|
1863
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1864
|
+
CLI 0(R5),C')' End bracket?
|
1865
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1866
|
+
*
|
1867
|
+
LA R5,1(,R5) Point to next byte
|
1868
|
+
S R4,=F'01' Adjust remaining length
|
1869
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1870
|
+
*
|
1871
|
+
MVI W_MODE,C'Y' Mark MODE parm complete
|
1872
|
+
MVC O_MODE,S_OFF Move MODE=OFFLINE
|
1873
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1874
|
+
***********************************************************************
|
1875
|
+
* SORT parameter specified. *
|
1876
|
+
***********************************************************************
|
1877
|
+
QM_0255 DS 0H
|
1878
|
+
LA R0,QM_0255 Mark the spot
|
1879
|
+
CLI W_SORT,C'Y' SORT parm performed?
|
1880
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1881
|
+
*
|
1882
|
+
LA R5,4(,R5) Point past command
|
1883
|
+
S R4,=F'04' Adjust remaining length
|
1884
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1885
|
+
*
|
1886
|
+
CLI 0(R5),C'=' Equal sign?
|
1887
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1888
|
+
LA R5,1(,R5) Point to next byte
|
1889
|
+
S R4,=F'01' Adjust remaining length
|
1890
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1891
|
+
*
|
1892
|
+
XR R1,R1 Clear R1
|
1893
|
+
ST R5,W_ADDR Save field data address
|
1894
|
+
***********************************************************************
|
1895
|
+
* Determine field name length for SORT *
|
1896
|
+
***********************************************************************
|
1897
|
+
QM_0255A DS 0H
|
1898
|
+
LA R0,QM_0255A Mark the spot
|
1899
|
+
CLI 0(R5),C')' End bracket?
|
1900
|
+
BC B'1000',QM_0255B ... yes, move to OPTIONS table
|
1901
|
+
LA R5,1(,R5) Point to next byte
|
1902
|
+
LA R1,1(,R1) Increment field name length
|
1903
|
+
C R1,MAX_LEN Field length exceed maximum?
|
1904
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1905
|
+
BCT R4,QM_0255A Continue parsing
|
1906
|
+
BC B'1111',ER_40007 Syntax error when zero
|
1907
|
+
***********************************************************************
|
1908
|
+
* Move field name to SORT entry of OPTIONS table *
|
1909
|
+
***********************************************************************
|
1910
|
+
QM_0255B DS 0H
|
1911
|
+
LA R0,QM_0255B Mark the spot
|
1912
|
+
LA R5,1(,R5) Point to next byte
|
1913
|
+
S R4,=F'01' Adjust remaining length
|
1914
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1915
|
+
*
|
1916
|
+
S R1,=F'1' Adjust field length
|
1917
|
+
L R15,W_ADDR Load field data address
|
1918
|
+
LA R14,O_SORT Load SORT field name
|
1919
|
+
EX R1,MVC_0255 ... and move to OPTIONS table
|
1920
|
+
*
|
1921
|
+
MVI W_SORT,C'Y' Mark MODE parm complete
|
1922
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1923
|
+
*
|
1924
|
+
MVC_0255 MVC 0(0,R14),0(R15) Move field to OPTIONS table
|
1925
|
+
*
|
1926
|
+
***********************************************************************
|
1927
|
+
* ROWS parameter specified. *
|
1928
|
+
***********************************************************************
|
1929
|
+
QM_0256 DS 0H
|
1930
|
+
LA R0,QM_0256 Mark the spot
|
1931
|
+
CLI W_ROWS,C'Y' ROWS parm performed?
|
1932
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1933
|
+
*
|
1934
|
+
LA R5,4(,R5) Point past command
|
1935
|
+
S R4,=F'04' Adjust remaining length
|
1936
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1937
|
+
*
|
1938
|
+
CLI 0(R5),C'=' Equal sign?
|
1939
|
+
BC B'0111',ER_40007 ... no, syntax error
|
1940
|
+
LA R5,1(,R5) Point to next byte
|
1941
|
+
S R4,=F'01' Adjust remaining length
|
1942
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1943
|
+
*
|
1944
|
+
XR R1,R1 Clear R1
|
1945
|
+
ST R5,W_ADDR Save field data address
|
1946
|
+
***********************************************************************
|
1947
|
+
* Determine value of ROWS= parameter *
|
1948
|
+
***********************************************************************
|
1949
|
+
QM_0256A DS 0H
|
1950
|
+
LA R0,QM_0256A Mark the spot
|
1951
|
+
CLI 0(R5),C')' End bracket?
|
1952
|
+
BC B'1000',QM_0256B ... yes, move to OPTIONS table
|
1953
|
+
LA R5,1(,R5) Point to next byte
|
1954
|
+
LA R1,1(,R1) Increment ROWS value length
|
1955
|
+
C R1,=F'6' Value exceed maximum?
|
1956
|
+
BC B'1000',ER_40007 ... yes, syntax error
|
1957
|
+
BCT R4,QM_0256A Continue parsing
|
1958
|
+
BC B'1111',ER_40007 Syntax error when zero
|
1959
|
+
***********************************************************************
|
1960
|
+
* Move value to ROWS entry of OPTIONS table *
|
1961
|
+
***********************************************************************
|
1962
|
+
QM_0256B DS 0H
|
1963
|
+
LA R0,QM_0256B Mark the spot
|
1964
|
+
LA R5,1(,R5) Point to next byte
|
1965
|
+
S R4,=F'01' Adjust remaining length
|
1966
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1967
|
+
*
|
1968
|
+
LA R15,6 Load max ROWS field length
|
1969
|
+
SR R15,R1 Subtract length
|
1970
|
+
LA R14,O_ROWS Load ROWS address in Object
|
1971
|
+
LA R14,0(R15,R14) Set target field
|
1972
|
+
L R15,W_ADDR Set source field
|
1973
|
+
S R1,=F'1' Adjust for MVC
|
1974
|
+
EX R1,MVC_0256 Move ROWS to Oject table
|
1975
|
+
*
|
1976
|
+
MVI W_ROWS,C'Y' Mark ROWS parm complete
|
1977
|
+
BC B'1111',QM_025X Continue FORMAT parsing
|
1978
|
+
*
|
1979
|
+
MVC_0256 MVC 0(0,R14),0(R15) Move ROWS to ZD work field
|
1980
|
+
*
|
1981
|
+
***********************************************************************
|
1982
|
+
* When a comma is the next byte, continue with FORMAT parsing *
|
1983
|
+
***********************************************************************
|
1984
|
+
QM_025X DS 0H
|
1985
|
+
LA R0,QM_025X Mark the spot
|
1986
|
+
CLI 0(R5),C',' Comma?
|
1987
|
+
BC B'0111',QM_025Z ... no, continue
|
1988
|
+
*
|
1989
|
+
LA R5,1(,R5) Point to next byte
|
1990
|
+
S R4,=F'01' Adjust remaining length
|
1991
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
1992
|
+
BC B'1111',QM_0251 Get next OPTIONS parm
|
1993
|
+
***********************************************************************
|
1994
|
+
* When a end parenthesis is the next byte, *
|
1995
|
+
* 1). When EOQS, parsing is complete *
|
1996
|
+
* 2). When not EOQS, continue SELECT parsing *
|
1997
|
+
***********************************************************************
|
1998
|
+
QM_025Z DS 0H
|
1999
|
+
LA R0,QM_025Z Mark the spot
|
2000
|
+
CLI 0(R5),C')' Close parenthesis
|
2001
|
+
BC B'0111',ER_40007 ... no, syntax error
|
2002
|
+
*
|
2003
|
+
LA R5,1(,R5) Point to next byte
|
2004
|
+
S R4,=F'01' Adjust remaining length
|
2005
|
+
BC B'1000',QM_0500 When zero, parsing complete
|
2006
|
+
*
|
2007
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2008
|
+
BC B'0111',ER_40007 ... no, syntax error
|
2009
|
+
LA R5,1(,R5) Point to next byte
|
2010
|
+
S R4,=F'1' Adjust remaining length
|
2011
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
2012
|
+
BC B'1111',QM_0210 Continue parsing
|
2013
|
+
*
|
2014
|
+
***********************************************************************
|
2015
|
+
* Parse PUT request, using WEB RECEIVE input *
|
2016
|
+
***********************************************************************
|
2017
|
+
QM_0300 DS 0H
|
2018
|
+
L R4,R_LENGTH Load RECEIVE length
|
2019
|
+
L R5,WR_ADDR Load RECEIVE address
|
2020
|
+
*
|
2021
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
2022
|
+
CLC 0(6,R5),S_UPDATE Is this an UPDATE command?
|
2023
|
+
BC B'0111',ER_40503 ... no, invalid command
|
2024
|
+
LA R5,6(,R5) Point to next byte
|
2025
|
+
S R4,=F'06' Adjust remaining length
|
2026
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
2027
|
+
*
|
2028
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2029
|
+
BC B'0111',ER_40007 ... no, syntax error
|
2030
|
+
LA R5,1(,R5) Point to next byte
|
2031
|
+
S R4,=F'01' Adjust remaining length
|
2032
|
+
BC B'1100',ER_40007 Syntax error when EOQS
|
2033
|
+
***********************************************************************
|
2034
|
+
* Check PUT request for zQL commands. *
|
2035
|
+
* Valid commands are FIELDS, TTL and WHERE. *
|
2036
|
+
***********************************************************************
|
2037
|
+
QM_0310 DS 0H
|
2038
|
+
LA R0,QM_0310 Mark the spot
|
2039
|
+
CLI 0(R5),C'(' Open parenthesis?
|
2040
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2041
|
+
LA R5,1(,R5) Point to next byte
|
2042
|
+
S R4,=F'01' Adjust remaining length
|
2043
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2044
|
+
*
|
2045
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
2046
|
+
CLC 0(3,R5),S_TTL Is this a TTL command?
|
2047
|
+
BC B'1000',QM_0320 ... yes, process
|
2048
|
+
CLC 0(6,R5),S_FIELDS Is this a FIELDS command?
|
2049
|
+
BC B'1000',QM_0330 ... yes, process
|
2050
|
+
CLC 0(5,R5),S_WHERE Is this a WHERE command?
|
2051
|
+
BC B'1000',QM_0340 ... yes, process
|
2052
|
+
BC B'1000',ER_40008 ... no, syntax error
|
2053
|
+
***********************************************************************
|
2054
|
+
* Process TTL command *
|
2055
|
+
***********************************************************************
|
2056
|
+
QM_0320 DS 0H
|
2057
|
+
CLI W_TTL,C'Y' TTL command performed?
|
2058
|
+
BC B'1000',ER_40008 ... yes, syntax error
|
2059
|
+
***********************************************************************
|
2060
|
+
* Begin parsing TTL command *
|
2061
|
+
***********************************************************************
|
2062
|
+
QM_0321 DS 0H
|
2063
|
+
LA R0,QM_0321 Mark the spot
|
2064
|
+
LA R5,3(,R5) Point past command
|
2065
|
+
S R4,=F'03' Adjust remaining length
|
2066
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2067
|
+
*
|
2068
|
+
CLI 0(R5),C'(' Begin bracket?
|
2069
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2070
|
+
LA R5,1(,R5) Point to next byte
|
2071
|
+
S R4,=F'01' Adjust remaining length
|
2072
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2073
|
+
XR R1,R1 Clear counter
|
2074
|
+
ST R5,W_ADDR Save beginning TTL address
|
2075
|
+
LR R15,R5 Load beginning TTL address
|
2076
|
+
***********************************************************************
|
2077
|
+
* Determine length of TTL and perform editing. *
|
2078
|
+
***********************************************************************
|
2079
|
+
QM_0322 DS 0H
|
2080
|
+
LA R0,QM_0322 Mark the spot
|
2081
|
+
CLI 0(R5),C')' End bracket?
|
2082
|
+
BC B'1000',QM_0323 ... yes, continue process
|
2083
|
+
CLI 0(R5),X'F0' Compare TTL byte to zero
|
2084
|
+
BC B'0100',ER_40008 ... when less, syntax error
|
2085
|
+
CLI 0(R5),X'FA' Compare TTL byte to FA+
|
2086
|
+
BC B'1010',ER_40008 ... when more, syntax error
|
2087
|
+
C R1,=F'5' Maximum TTL length?
|
2088
|
+
BC B'0010',ER_40008 ... yes, syntax error
|
2089
|
+
*
|
2090
|
+
LA R1,1(,R1) Increment TTL length
|
2091
|
+
LA R5,1(,R5) Point to next byte
|
2092
|
+
BCT R4,QM_0322 Continue parsing
|
2093
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2094
|
+
***********************************************************************
|
2095
|
+
* Issue PUT CONTAINER for TTL field *
|
2096
|
+
***********************************************************************
|
2097
|
+
QM_0323 DS 0H
|
2098
|
+
LA R0,QM_0323 Mark the spot
|
2099
|
+
LA R5,1(,R5) Point to next byte
|
2100
|
+
S R4,=F'01' Adjust remaining length
|
2101
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2102
|
+
*
|
2103
|
+
CLI 0(R5),C')' Close parenthesis?
|
2104
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2105
|
+
*
|
2106
|
+
MVI W_TTL,C'Y' Mark TTL command complete
|
2107
|
+
*
|
2108
|
+
MVC W_NAME,C_TTL Move TTL container name
|
2109
|
+
ST R1,W_LENGTH Save data length
|
2110
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2111
|
+
*
|
2112
|
+
LA R0,QM_0323 Mark the spot
|
2113
|
+
LA R5,1(,R5) Point to next byte
|
2114
|
+
S R4,=F'01' Adjust remaining length
|
2115
|
+
BC B'1000',QM_0500 When zero, parsing complete
|
2116
|
+
*
|
2117
|
+
CLI 0(R5),C',' Comma?
|
2118
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2119
|
+
*
|
2120
|
+
LA R5,1(,R5) Point to next byte
|
2121
|
+
S R4,=F'01' Adjust remaining length
|
2122
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2123
|
+
BC B'1111',QM_0310 Continue PUT parsing
|
2124
|
+
***********************************************************************
|
2125
|
+
* FIELDS command *
|
2126
|
+
***********************************************************************
|
2127
|
+
QM_0330 DS 0H
|
2128
|
+
CLI W_FIELDS,C'Y' FIELDS command performed?
|
2129
|
+
BC B'1000',ER_40008 ... yes, syntax error
|
2130
|
+
*
|
2131
|
+
LA R5,6(,R5) Point past command
|
2132
|
+
S R4,=F'06' Adjust remaining length
|
2133
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2134
|
+
***********************************************************************
|
2135
|
+
* Begin parsing FIELDS command *
|
2136
|
+
***********************************************************************
|
2137
|
+
QM_0331 DS 0H
|
2138
|
+
LA R0,QM_0331 Mark the spot
|
2139
|
+
CLI 0(R5),C'(' Begin bracket?
|
2140
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2141
|
+
LA R5,1(,R5) Point to next byte
|
2142
|
+
S R4,=F'01' Adjust remaining length
|
2143
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2144
|
+
*
|
2145
|
+
XR R1,R1 Clear R1 (counter)
|
2146
|
+
ST R5,W_ADDR Save beginning address
|
2147
|
+
LR R15,R5 Load beginning address
|
2148
|
+
***********************************************************************
|
2149
|
+
* Determine field name length. *
|
2150
|
+
***********************************************************************
|
2151
|
+
QM_0332 DS 0H
|
2152
|
+
LA R0,QM_0332 Mark the spot
|
2153
|
+
CLI 0(R5),C'=' Equal sign (end of field)?
|
2154
|
+
BC B'1000',QM_0333 ... yes, process
|
2155
|
+
C R1,=F'16' Exceed maximum field length?
|
2156
|
+
BC B'0011',ER_40008 ... yes, syntax error
|
2157
|
+
LA R1,1(,R1) Increment field name length
|
2158
|
+
LA R5,1(,R5) Point to next byte
|
2159
|
+
BCT R4,QM_0332 Continue evaluation
|
2160
|
+
BC B'1111',ER_40008 EOF, syntax error
|
2161
|
+
***********************************************************************
|
2162
|
+
* Address FAxxFD table *
|
2163
|
+
***********************************************************************
|
2164
|
+
QM_0333 DS 0H
|
2165
|
+
LA R0,QM_0332 Mark the spot
|
2166
|
+
LA R5,1(,R5) Point to next byte
|
2167
|
+
S R4,=F'01' Adjust remaining length
|
2168
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2169
|
+
*
|
2170
|
+
L R9,FD_GM Load FAxxFD address
|
2171
|
+
USING FD_DSECT,R9 ... tell assembler
|
2172
|
+
L R7,FD_LEN Load FD table length
|
2173
|
+
LA R6,E_FD Load FD entry length
|
2174
|
+
S R1,ONE Adjust before EX command
|
2175
|
+
***********************************************************************
|
2176
|
+
* Verify the field name is in FAxxFD *
|
2177
|
+
***********************************************************************
|
2178
|
+
QM_0334 DS 0H
|
2179
|
+
LA R0,QM_0334 Mark the spot
|
2180
|
+
LA R14,F_NAME Point to field name
|
2181
|
+
EX R1,CLC_0334 Field name match?
|
2182
|
+
BC B'1000',QM_0335 ... yes, process
|
2183
|
+
LA R9,0(R6,R9) Point to next FD entry
|
2184
|
+
SR R7,R6 Reduce total length by an entry
|
2185
|
+
BC B'0010',QM_0334 Continue search
|
2186
|
+
MVC C_FIELD,HEX_40 Move spaces to field name
|
2187
|
+
LA R14,C_FIELD Point to field name
|
2188
|
+
EX R1,MVC_0334 Move field name to diagnostics
|
2189
|
+
BC B'1111',ER_41203 ... EOF, syntax error
|
2190
|
+
CLC_0334 CLC 0(0,R14),0(R15) Check field name
|
2191
|
+
MVC_0334 MVC 0(0,R14),0(R15) Move field name
|
2192
|
+
*
|
2193
|
+
***********************************************************************
|
2194
|
+
* Move field name to parser array *
|
2195
|
+
***********************************************************************
|
2196
|
+
QM_0335 DS 0H
|
2197
|
+
LA R0,QM_0335 Mark the spot
|
2198
|
+
MVC W_NAME,HEX_40 Clear field
|
2199
|
+
LA R14,W_NAME Point to field name
|
2200
|
+
EX R1,MVC_0335 Set container name
|
2201
|
+
*
|
2202
|
+
L R8,PA_GM Load parser array address
|
2203
|
+
USING PA_DSECT,R8 ... tell assembler
|
2204
|
+
*
|
2205
|
+
LA R7,E_PA Load parser array entry length
|
2206
|
+
XR R6,R6 Clear even register
|
2207
|
+
L R1,W_INDEX Load PA index
|
2208
|
+
MR R6,R1 Multiply by entry length
|
2209
|
+
LA R8,0(R7,R8) Point to current PA entry
|
2210
|
+
*
|
2211
|
+
LA R1,1(,R1) Increment PA index
|
2212
|
+
ST R1,W_INDEX Save PA index
|
2213
|
+
C R1,MAX_PA PA index exceeded?
|
2214
|
+
BC B'0010',ER_41406 ... yes, STATUS(414)
|
2215
|
+
*
|
2216
|
+
MVC P_NAME,F_NAME Move field name to PA
|
2217
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
2218
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
2219
|
+
PACK P_ID,F_ID Pack field ID to PA
|
2220
|
+
PACK P_COL,F_COL Pack field column to PA
|
2221
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
2222
|
+
*
|
2223
|
+
XR R1,R1 Clear R1
|
2224
|
+
ST R5,W_ADDR Save field data address
|
2225
|
+
BC B'1111',QM_0336 Determine field length
|
2226
|
+
MVC_0335 MVC 0(0,R14),0(R15) Set container name
|
2227
|
+
***********************************************************************
|
2228
|
+
* Determine length of data for this field *
|
2229
|
+
***********************************************************************
|
2230
|
+
QM_0336 DS 0H
|
2231
|
+
LA R0,QM_0336 Mark the spot
|
2232
|
+
CLI 0(R5),C')' End bracket?
|
2233
|
+
BC B'1000',QM_0337 ... yes, PUT CONTAINER
|
2234
|
+
LA R5,1(,R5) Point to next byte
|
2235
|
+
LA R1,1(,R1) Increment field length
|
2236
|
+
C R1,MAX_LEN Field length exceed maximum?
|
2237
|
+
BC B'1000',ER_40008 ... yes, syntax error
|
2238
|
+
BCT R4,QM_0336 Continue parsing
|
2239
|
+
BC B'1111',ER_40008 Syntax error when zero
|
2240
|
+
***********************************************************************
|
2241
|
+
* Issue PUT CONTAINER for this data field *
|
2242
|
+
***********************************************************************
|
2243
|
+
QM_0337 DS 0H
|
2244
|
+
LA R0,QM_0337 Mark the spot
|
2245
|
+
LA R5,1(,R5) Point to next byte
|
2246
|
+
S R4,=F'01' Adjust remaining length
|
2247
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2248
|
+
*
|
2249
|
+
ST R1,W_LENGTH Save field length
|
2250
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2251
|
+
*
|
2252
|
+
LA R0,QM_0337 Mark the spot
|
2253
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2254
|
+
BC B'1000',QM_0338 ... yes, prepare to parse
|
2255
|
+
*
|
2256
|
+
CLI 0(R5),C')' Close Parenthesis?
|
2257
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2258
|
+
*
|
2259
|
+
LA R5,1(,R5) Point to next byte
|
2260
|
+
S R4,=F'1' Adjust remaining length
|
2261
|
+
BC B'1100',QM_0500 When zero, parsing is complete
|
2262
|
+
*
|
2263
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2264
|
+
BC B'0111',ER_40008 ... yes, prepar to parse
|
2265
|
+
LA R5,1(,R5) Point to next byte
|
2266
|
+
S R4,=F'1' Adjust remaining length
|
2267
|
+
BC B'1100',ER_40008 When zero, syntax error
|
2268
|
+
MVI W_FIELDS,C'Y' Set FIELDS command complete
|
2269
|
+
BC B'1111',QM_0310 Continue parsing
|
2270
|
+
*
|
2271
|
+
***********************************************************************
|
2272
|
+
* Prepare to parse next FIELDS request *
|
2273
|
+
***********************************************************************
|
2274
|
+
QM_0338 DS 0H
|
2275
|
+
LA R0,QM_0336 Mark the spot
|
2276
|
+
LA R5,1(,R5) Point to next byte
|
2277
|
+
S R4,=F'1' Adjust remaining length
|
2278
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2279
|
+
BC B'1111',QM_0331 Continue with FIELDS
|
2280
|
+
***********************************************************************
|
2281
|
+
* WHERE command *
|
2282
|
+
***********************************************************************
|
2283
|
+
QM_0340 DS 0H
|
2284
|
+
CLI W_WHERE,C'Y' WHERE command performed?
|
2285
|
+
BC B'1000',ER_40008 ... yes, syntax error
|
2286
|
+
*
|
2287
|
+
LA R5,5(,R5) Point past command
|
2288
|
+
S R4,=F'05' Adjust remaining length
|
2289
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2290
|
+
***********************************************************************
|
2291
|
+
* Begin parsing WHERE command *
|
2292
|
+
***********************************************************************
|
2293
|
+
QM_0341 DS 0H
|
2294
|
+
LA R0,QM_0341 Mark the spot
|
2295
|
+
CLI 0(R5),C'(' Begin bracket?
|
2296
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2297
|
+
LA R5,1(,R5) Point to next byte
|
2298
|
+
S R4,=F'01' Adjust remaining length
|
2299
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2300
|
+
*
|
2301
|
+
XR R1,R1 Clear R1 (counter)
|
2302
|
+
ST R5,W_ADDR Save beginning address
|
2303
|
+
LR R15,R5 Load beginning address
|
2304
|
+
***********************************************************************
|
2305
|
+
* Determine field name length. *
|
2306
|
+
***********************************************************************
|
2307
|
+
QM_0342 DS 0H
|
2308
|
+
LA R0,QM_0342 Mark the spot
|
2309
|
+
CLI 0(R5),C'=' Equal sign (end of field)?
|
2310
|
+
BC B'1000',QM_0343 ... yes, process
|
2311
|
+
C R1,=F'16' Exceed maximum field length?
|
2312
|
+
BC B'0011',ER_40008 ... yes, syntax error
|
2313
|
+
LA R1,1(,R1) Increment field name length
|
2314
|
+
LA R5,1(,R5) Point to next byte
|
2315
|
+
BCT R4,QM_0342 Continue evaluation
|
2316
|
+
BC B'1111',ER_40008 EOF, syntax error
|
2317
|
+
***********************************************************************
|
2318
|
+
* Address FAxxFD table *
|
2319
|
+
***********************************************************************
|
2320
|
+
QM_0343 DS 0H
|
2321
|
+
LA R0,QM_0343 Mark the spot
|
2322
|
+
LA R5,1(,R5) Point to next byte
|
2323
|
+
S R4,=F'1' Adjust remaining length
|
2324
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2325
|
+
*
|
2326
|
+
L R9,FD_GM Load FAxxFD address
|
2327
|
+
USING FD_DSECT,R9 ... tell assembler
|
2328
|
+
L R7,FD_LEN Load FD table length
|
2329
|
+
LA R6,E_FD Load FD entry length
|
2330
|
+
S R1,ONE Adjust before EX command
|
2331
|
+
***********************************************************************
|
2332
|
+
* Verify the field name is in FAxxFD *
|
2333
|
+
***********************************************************************
|
2334
|
+
QM_0344 DS 0H
|
2335
|
+
LA R0,QM_0344 Mark the spot
|
2336
|
+
LA R14,F_NAME Point to field name
|
2337
|
+
EX R1,CLC_0344 Field name match?
|
2338
|
+
BC B'1000',QM_0345 ... yes, process
|
2339
|
+
LA R9,0(R6,R9) Point to next FD entry
|
2340
|
+
SR R7,R6 Reduce total length by an entry
|
2341
|
+
BC B'0010',QM_0344 Continue search
|
2342
|
+
BC B'1111',ER_40008 EOF, syntax error
|
2343
|
+
CLC_0344 CLC 0(0,R14),0(R15) Check field name
|
2344
|
+
***********************************************************************
|
2345
|
+
* Move field name to parser array *
|
2346
|
+
***********************************************************************
|
2347
|
+
QM_0345 DS 0H
|
2348
|
+
MVC W_NAME,HEX_40 Clear field
|
2349
|
+
LA R14,W_NAME Point to field name
|
2350
|
+
EX R1,MVC_0345 Set container name
|
2351
|
+
*
|
2352
|
+
L R8,PA_GM Load parser array address
|
2353
|
+
USING PA_DSECT,R8 ... tell assembler
|
2354
|
+
*
|
2355
|
+
LA R7,E_PA Load parser array entry length
|
2356
|
+
XR R6,R6 Clear even register
|
2357
|
+
L R1,W_INDEX Load PA index
|
2358
|
+
MR R6,R1 Multiply by entry length
|
2359
|
+
LA R8,0(R7,R8) Point to current PA entry
|
2360
|
+
*
|
2361
|
+
LA R1,1(,R1) Increment PA index
|
2362
|
+
ST R1,W_INDEX Save PA index
|
2363
|
+
C R1,MAX_PA PA index exceeded?
|
2364
|
+
BC B'0010',ER_41407 ... yes, STATUS(414)
|
2365
|
+
*
|
2366
|
+
MVC P_NAME,F_NAME Move field name to PA
|
2367
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
2368
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
2369
|
+
PACK P_ID,F_ID Pack field ID to PA
|
2370
|
+
PACK P_COL,F_COL Pack field column to PA
|
2371
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
2372
|
+
*
|
2373
|
+
XR R1,R1 Clear R1
|
2374
|
+
ST R5,W_ADDR Save field data address
|
2375
|
+
BC B'1111',QM_0346 Determine field length
|
2376
|
+
MVC_0345 MVC 0(0,R14),0(R15) Set container name
|
2377
|
+
***********************************************************************
|
2378
|
+
* Determine length of data for this field *
|
2379
|
+
***********************************************************************
|
2380
|
+
QM_0346 DS 0H
|
2381
|
+
LA R0,QM_0346 Mark the spot
|
2382
|
+
CLI 0(R5),C')' End bracket?
|
2383
|
+
BC B'1000',QM_0347 ... yes, PUT CONTAINER
|
2384
|
+
LA R5,1(,R5) Point to next byte
|
2385
|
+
LA R1,1(,R1) Increment field length
|
2386
|
+
C R1,MAX_LEN Field length exceed maximum?
|
2387
|
+
BC B'1000',ER_40008 ... yes, syntax error
|
2388
|
+
BCT R4,QM_0336 Continue parsing
|
2389
|
+
BC B'1111',ER_40008 Syntax error when zero
|
2390
|
+
***********************************************************************
|
2391
|
+
* Issue PUT CONTAINER for this data field *
|
2392
|
+
***********************************************************************
|
2393
|
+
QM_0347 DS 0H
|
2394
|
+
LA R0,QM_0337 Mark the spot
|
2395
|
+
LA R5,1(,R5) Point to next byte
|
2396
|
+
S R4,=F'01' Adjust remaining length
|
2397
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2398
|
+
*
|
2399
|
+
ST R1,W_LENGTH Save field length
|
2400
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2401
|
+
*
|
2402
|
+
LA R0,QM_0347 Mark the spot
|
2403
|
+
*
|
2404
|
+
CLI 0(R5),C')' Close parenthesis?
|
2405
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2406
|
+
*
|
2407
|
+
LA R5,1(,R5) Point to next byte
|
2408
|
+
S R4,=F'1' Adjust remaining length
|
2409
|
+
BC B'1100',QM_0500 When zero, parsing complete
|
2410
|
+
*
|
2411
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2412
|
+
BC B'0111',ER_40008 ... no, syntax error
|
2413
|
+
*
|
2414
|
+
LA R5,1(,R5) Point to next byte
|
2415
|
+
S R4,=F'1' Adjust remaining length
|
2416
|
+
BC B'1100',ER_40008 Syntax error when EOQS
|
2417
|
+
MVI W_WHERE,C'Y' Set WHERE command complete
|
2418
|
+
BC B'1111',QM_0310 Continue parsing
|
2419
|
+
*
|
2420
|
+
***********************************************************************
|
2421
|
+
* Parse DELETE request, using the Query String *
|
2422
|
+
* Since the WEB EXTRACT command moves the Query String 'into' an area *
|
2423
|
+
* instead of setting a pointer, only a three byte area is defined for *
|
2424
|
+
* the EXTRACT command. The three bytes are used to determine whether *
|
2425
|
+
* the request is basic mode or query mode (zQL). When query mode, *
|
2426
|
+
* parse the DFHCOMMAREA for the beginning of the query string and *
|
2427
|
+
* save the pointer address. This reduces the amount of DFHEISTG *
|
2428
|
+
* storage required for the Query String and eliminates a GETMAIN. *
|
2429
|
+
***********************************************************************
|
2430
|
+
QM_0400 DS 0H
|
2431
|
+
LA R0,QM_0400 Mark the spot
|
2432
|
+
BAS R14,CA_0010 Parse DFHCOMMAREA for QS
|
2433
|
+
USING DFHCA,R5 ... tell assembler
|
2434
|
+
L R4,L_QUERY Load query string length
|
2435
|
+
LA R5,3(,R5) Skip past the zQL command
|
2436
|
+
S R4,=F'3' Adjust remaining length
|
2437
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2438
|
+
*
|
2439
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2440
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2441
|
+
LA R5,1(,R5) Point to next byte
|
2442
|
+
S R4,=F'1' Adjust remaining length
|
2443
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2444
|
+
*
|
2445
|
+
OC 0(6,R5),HEX_40 Set upper case bits
|
2446
|
+
CLC 0(6,R5),S_DELETE Is this a DELETE command?
|
2447
|
+
BC B'0111',ER_40504 ... no, invalid command
|
2448
|
+
LA R5,6(,R5) Point to next byte
|
2449
|
+
S R4,=F'6' Adjust remaining length
|
2450
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2451
|
+
*
|
2452
|
+
CLI 0(R5),C',' Is next byte a comma?
|
2453
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2454
|
+
LA R5,1(,R5) Point to next byte
|
2455
|
+
S R4,=F'1' Adjust remaining length
|
2456
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2457
|
+
*
|
2458
|
+
CLI 0(R5),C'(' Open parenthesis?
|
2459
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2460
|
+
LA R5,1(,R5) Point to next byte
|
2461
|
+
S R4,=F'1' Adjust remaining length
|
2462
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2463
|
+
*
|
2464
|
+
OC 0(5,R5),HEX_40 Set upper case bits
|
2465
|
+
CLC 0(5,R5),S_WHERE Is this a WHERE statement?
|
2466
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2467
|
+
LA R5,5(,R5) Point to next byte
|
2468
|
+
S R4,=F'5' Adjust remaining length
|
2469
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2470
|
+
*
|
2471
|
+
CLI 0(R5),C'(' Begin Bracket?
|
2472
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2473
|
+
LA R5,1(,R5) Point to next byte
|
2474
|
+
S R4,=F'1' Adjust remaining length
|
2475
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2476
|
+
*
|
2477
|
+
XR R1,R1 Clear R1
|
2478
|
+
ST R5,W_ADDR Save field name address
|
2479
|
+
LR R15,R5 Load field name address
|
2480
|
+
***********************************************************************
|
2481
|
+
* Determine primary key field length *
|
2482
|
+
***********************************************************************
|
2483
|
+
QM_0410 DS 0H
|
2484
|
+
LA R0,QM_0410 Mark the spot
|
2485
|
+
CLI 0(R5),C'=' Equal sign (end of field)?
|
2486
|
+
BC B'1000',QM_0420 ... yes, continue
|
2487
|
+
C R1,=F'16' Exceed maximum field length?
|
2488
|
+
BC B'0011',ER_40009 ... yes, syntax error
|
2489
|
+
LA R1,1(,R1) Add one to field length
|
2490
|
+
LA R5,1(,R5) Point to next byte
|
2491
|
+
BCT R4,QM_0410 Continue parsing
|
2492
|
+
BC B'1111',ER_40009 EOF, syntax error
|
2493
|
+
***********************************************************************
|
2494
|
+
* Address FAxxFD table. *
|
2495
|
+
* Validate primary key field selected. *
|
2496
|
+
***********************************************************************
|
2497
|
+
QM_0420 DS 0H
|
2498
|
+
LA R0,QM_0420 Mark the spot
|
2499
|
+
LA R5,1(,R5) Point to next byte
|
2500
|
+
S R4,=F'1' Adjust remaining length
|
2501
|
+
BC B'1100',ER_40009 Syntax error wehn EOQS
|
2502
|
+
*
|
2503
|
+
L R9,FD_GM Load FAxxFD address
|
2504
|
+
USING FD_DSECT,R9 ... tell assembler
|
2505
|
+
S R1,ONE Adjust before EX command
|
2506
|
+
LA R14,F_NAME Point to field name
|
2507
|
+
EX R1,CLC_0420 Primary key selected?
|
2508
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2509
|
+
*
|
2510
|
+
MVC W_NAME,HEX_40 Clear field
|
2511
|
+
LA R14,W_NAME Point to field name
|
2512
|
+
EX R1,MVC_0420 Set container name
|
2513
|
+
*
|
2514
|
+
L R8,PA_GM Load parser array address
|
2515
|
+
USING PA_DSECT,R8 ... tell assembler
|
2516
|
+
MVC P_NAME,W_NAME Move field name to PA
|
2517
|
+
MVC P_TYPE,F_TYPE Move field type to PA
|
2518
|
+
PACK P_SEC,F_SEC Pack field security to PA
|
2519
|
+
PACK P_ID,F_ID Pack field ID to PA
|
2520
|
+
PACK P_COL,F_COL Pack field column to PA
|
2521
|
+
PACK P_LEN,F_LEN Pack field length to PA
|
2522
|
+
MVC W_INDEX,=F'1' Set PA index to one
|
2523
|
+
*
|
2524
|
+
XR R1,R1 Clear R1
|
2525
|
+
ST R5,W_ADDR Save field data address
|
2526
|
+
BC B'1111',QM_0430 Determine field length
|
2527
|
+
CLC_0420 CLC 0(0,R14),0(R15) Check field name
|
2528
|
+
MVC_0420 MVC 0(0,R14),0(R15) Move field name
|
2529
|
+
***********************************************************************
|
2530
|
+
* Determine length of primary key data *
|
2531
|
+
***********************************************************************
|
2532
|
+
QM_0430 DS 0H
|
2533
|
+
LA R0,QM_0430 Mark the spot
|
2534
|
+
CLI 0(R5),C')' End bracket?
|
2535
|
+
BC B'1000',QM_0440 ... yes, PUT CONTAINER
|
2536
|
+
LA R5,1(,R5) Point to next byte
|
2537
|
+
LA R1,1(,R1) Increment field length
|
2538
|
+
C R1,MAX_LEN Field length exceed maximum?
|
2539
|
+
BC B'1010',ER_40009 ... yes, syntax error
|
2540
|
+
BCT R4,QM_0430 Continue parse
|
2541
|
+
BC B'1111',ER_40009 Syntax error when zero
|
2542
|
+
***********************************************************************
|
2543
|
+
* Issue PUT CONTAINER for primary key field *
|
2544
|
+
***********************************************************************
|
2545
|
+
QM_0440 DS 0H
|
2546
|
+
LA R0,QM_0440 Mark the spot
|
2547
|
+
LA R5,1(,R5) Point to next byte
|
2548
|
+
S R4,=F'1' Adjust remaining length
|
2549
|
+
BC B'1100',ER_40009 Syntax error when EOQS
|
2550
|
+
*
|
2551
|
+
ST R1,W_LENGTH Save data length
|
2552
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2553
|
+
*
|
2554
|
+
LA R0,QM_0440 Mark the spot
|
2555
|
+
CLI 0(R5),C')' Close parenthesis?
|
2556
|
+
BC B'0111',ER_40009 ... no, syntax error
|
2557
|
+
*
|
2558
|
+
LA R5,1(,R5) Point to next byte
|
2559
|
+
S R4,=F'1' Adjust remaining length
|
2560
|
+
BC B'1100',QM_0500 When zero, parsing is complete
|
2561
|
+
BC B'0011',ER_40009 Syntax error when more available
|
2562
|
+
*
|
2563
|
+
***********************************************************************
|
2564
|
+
* Issue PUT CONTAINER for parsing array *
|
2565
|
+
***********************************************************************
|
2566
|
+
QM_0500 DS 0H
|
2567
|
+
MVC W_NAME,C_ARRAY Move ARRAY container name
|
2568
|
+
MVC W_ADDR,PA_GM Move parser array address
|
2569
|
+
*
|
2570
|
+
LA R7,E_PA Load parser array entry length
|
2571
|
+
XR R6,R6 Clear even register
|
2572
|
+
L R1,W_INDEX Load PA index
|
2573
|
+
MR R6,R1 Multiply by entry length
|
2574
|
+
ST R7,W_LENGTH Save parser array length
|
2575
|
+
*
|
2576
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2577
|
+
*
|
2578
|
+
***********************************************************************
|
2579
|
+
* Issue PUT CONTAINER for Options table *
|
2580
|
+
***********************************************************************
|
2581
|
+
QM_0510 DS 0H
|
2582
|
+
MVC W_NAME,C_OPTION Move OPTIONS container name
|
2583
|
+
LA R1,E_TABLE Load OPTIONS table length
|
2584
|
+
ST R1,W_LENGTH Save OPTIONS table length
|
2585
|
+
*
|
2586
|
+
LA R6,O_TABLE Load OPTIONS table address
|
2587
|
+
ST R6,W_ADDR Save OPTIONS table adress
|
2588
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2589
|
+
*
|
2590
|
+
***********************************************************************
|
2591
|
+
***********************************************************************
|
2592
|
+
* Query Security process. *
|
2593
|
+
***********************************************************************
|
2594
|
+
***********************************************************************
|
2595
|
+
QS_0010 DS 0H
|
2596
|
+
DROP R9 ... tell assembler
|
2597
|
+
CLI W_PREFIX,X'FF' URI '/replicate' prefix?
|
2598
|
+
BC B'1000',QS_0400 ... yes, bypass security
|
2599
|
+
*
|
2600
|
+
L R9,SD_GM Load FAxxSD address
|
2601
|
+
USING SD_DSECT,R9 ... tell assembler
|
2602
|
+
CLC W_SCHEME,DFHVALUE(HTTP) HTTP request?
|
2603
|
+
BC B'1000',QS_0100 ... yes, execute HTTP security
|
2604
|
+
BC B'0111',QS_0200 ... no, execute HTTPS security
|
2605
|
+
***********************************************************************
|
2606
|
+
* SCHEME is HTTP. Determine appropriate action *
|
2607
|
+
***********************************************************************
|
2608
|
+
QS_0100 DS 0H
|
2609
|
+
CLC W_METHOD(3),S_GET GET request?
|
2610
|
+
BC B'0111',QS_0120 ... no, check other methods
|
2611
|
+
***********************************************************************
|
2612
|
+
* SCHEME is HTTP and this is a GET request *
|
2613
|
+
***********************************************************************
|
2614
|
+
QS_0110 DS 0H
|
2615
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
2616
|
+
BC B'0111',QS_0400 ... no, bypass security
|
2617
|
+
OC Q_STATUS,HEX_40 Set upper case bits
|
2618
|
+
CLC Q_STATUS,S_YEA QM Read Only enabled?
|
2619
|
+
BC B'1000',QS_0400 ... yes, bypass security
|
2620
|
+
BC B'0111',ER_40111 ... no, STATUS(401)
|
2621
|
+
***********************************************************************
|
2622
|
+
* SCHEME is HTTP and this is a PUT, POST, DELETE request *
|
2623
|
+
***********************************************************************
|
2624
|
+
QS_0120 DS 0H
|
2625
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
2626
|
+
BC B'1000',ER_40112 ... yes, STATUS(401)
|
2627
|
+
BC B'0111',QS_0400 ... no, bypass security
|
2628
|
+
***********************************************************************
|
2629
|
+
* SCHEME is HTTPS. Determine appropriate action *
|
2630
|
+
***********************************************************************
|
2631
|
+
QS_0200 DS 0H
|
2632
|
+
OC SD_RESP,SD_RESP FAxxSD defined?
|
2633
|
+
BC B'0111',QS_0400 ... no, bypass security
|
2634
|
+
*
|
2635
|
+
LA R4,E_USER Load user entry length
|
2636
|
+
L R5,SD_LEN Load SD template length
|
2637
|
+
LA R6,E_PREFIX Load SD prefix length
|
2638
|
+
SR R5,R6 Subtract prefix length
|
2639
|
+
AR R9,R6 Point to User entry
|
2640
|
+
USING SD_USER,R9 ... tell assembler
|
2641
|
+
***********************************************************************
|
2642
|
+
* Parse SD entry until EOT or a UserID match *
|
2643
|
+
***********************************************************************
|
2644
|
+
QS_0210 DS 0H
|
2645
|
+
CLC S_USER,C_USER UserID match FAxxSD?
|
2646
|
+
BC B'1000',QS_0220 ... yes, check request type
|
2647
|
+
QS_0211 DS 0H
|
2648
|
+
LA R9,0(R4,R9) Point to next entry
|
2649
|
+
SR R5,R4 Subtract user entry length
|
2650
|
+
BC B'0010',QS_0210 Continue search
|
2651
|
+
BC B'1111',ER_40113 EOT, STATUS(401)
|
2652
|
+
***********************************************************************
|
2653
|
+
* UserID matches FAxxSD entry. *
|
2654
|
+
* Now check HTTP METHOD and branch to compare with security entry *
|
2655
|
+
***********************************************************************
|
2656
|
+
QS_0220 DS 0H
|
2657
|
+
OC S_TYPE,HEX_40 Set upper case bits
|
2658
|
+
CLC W_METHOD(4),S_POST POST request?
|
2659
|
+
BC B'1000',QS_0221 ... yes, check SD type
|
2660
|
+
CLC W_METHOD(3),S_GET GET request?
|
2661
|
+
BC B'1000',QS_0222 ... yes, check SD type
|
2662
|
+
CLC W_METHOD(3),S_PUT PUT request?
|
2663
|
+
BC B'1000',QS_0223 ... yes, check SD type
|
2664
|
+
CLC W_METHOD(6),S_DELETE DELETE request?
|
2665
|
+
BC B'1000',QS_0224 ... yes, check SD type
|
2666
|
+
BC B'0111',ER_40005 ... no, WEB SEND STATUS(400)
|
2667
|
+
***********************************************************************
|
2668
|
+
* FAxxSD security entry must match HTTP METHOD *
|
2669
|
+
* POST must match security type of 'Write ' *
|
2670
|
+
***********************************************************************
|
2671
|
+
QS_0221 DS 0H
|
2672
|
+
CLC S_TYPE,S_WRITE Security entry for 'Write'?
|
2673
|
+
BC B'0111',QS_0211 ... no, continue search
|
2674
|
+
BC B'1111',QS_0300 ... yes, field level security
|
2675
|
+
***********************************************************************
|
2676
|
+
* FAxxSD security entry must match HTTP METHOD *
|
2677
|
+
* GET must match security type of 'Read ' *
|
2678
|
+
***********************************************************************
|
2679
|
+
QS_0222 DS 0H
|
2680
|
+
CLC S_TYPE,S_READ Security entry for 'Read'?
|
2681
|
+
BC B'0111',QS_0211 ... no, continue search
|
2682
|
+
BC B'1111',QS_0300 ... yes, field level security
|
2683
|
+
***********************************************************************
|
2684
|
+
* FAxxSD security entry must match HTTP METHOD *
|
2685
|
+
* PUT must match security type of 'Write ' *
|
2686
|
+
***********************************************************************
|
2687
|
+
QS_0223 DS 0H
|
2688
|
+
CLC S_TYPE,S_WRITE Security entry for 'Write'?
|
2689
|
+
BC B'0111',QS_0211 ... no, continue search
|
2690
|
+
BC B'1111',QS_0300 ... yes, field level security
|
2691
|
+
***********************************************************************
|
2692
|
+
* FAxxSD security entry must match HTTP METHOD *
|
2693
|
+
* DELETE must match security type of 'Delete' *
|
2694
|
+
***********************************************************************
|
2695
|
+
QS_0224 DS 0H
|
2696
|
+
CLC S_TYPE,S_DELETE Security entry for 'Delete'?
|
2697
|
+
BC B'0111',QS_0211 ... no, continue search
|
2698
|
+
BC B'1111',QS_0300 ... yes, field level security
|
2699
|
+
***********************************************************************
|
2700
|
+
* At this point, the Parser Array has every field presented in the *
|
2701
|
+
* zQL request along with the security level. *
|
2702
|
+
* Compare the UserID security level with each field level in the *
|
2703
|
+
* Parser Array. *
|
2704
|
+
***********************************************************************
|
2705
|
+
QS_0300 DS 0H
|
2706
|
+
L R4,W_INDEX Load PA index (# of entries)
|
2707
|
+
LA R6,E_PA Load PA entry length
|
2708
|
+
L R8,PA_GM Load PA entry address
|
2709
|
+
LTR R9,R9 R9 points to current UserID
|
2710
|
+
***********************************************************************
|
2711
|
+
* The field security level is in the Parser Array. Use this security *
|
2712
|
+
* level as a displacement into the UserID security level array. *
|
2713
|
+
***********************************************************************
|
2714
|
+
QS_0310 DS 0H
|
2715
|
+
LA R5,S_LEVELS Load UserID security levels
|
2716
|
+
ZAP W_PACK,P_SEC Pack field security level
|
2717
|
+
CVB R7,W_PACK Convert to index
|
2718
|
+
LA R5,0(R7,R5) Point to UserID security byte
|
2719
|
+
OI 0(R5),X'40' Set upper case
|
2720
|
+
CLI 0(R5),C'X' Field level permitted?
|
2721
|
+
BC B'0111',ER_40114 ... no, set reason code
|
2722
|
+
LA R8,0(R6,R8) Point to next PA entry
|
2723
|
+
BCT R4,QS_0310 Continue PA scan
|
2724
|
+
BC B'1111',QS_0400 CI and segment validation
|
2725
|
+
***********************************************************************
|
2726
|
+
* Check method and branch accordingly to set the appropriate *
|
2727
|
+
* Query Mode service program. *
|
2728
|
+
***********************************************************************
|
2729
|
+
QS_0400 DS 0H
|
2730
|
+
CLC W_METHOD(4),S_POST POST request?
|
2731
|
+
BC B'1000',QS_0410 ... yes, set service name
|
2732
|
+
CLC W_METHOD(3),S_GET GET request?
|
2733
|
+
BC B'1000',QS_0420 ... yes, set service name
|
2734
|
+
CLC W_METHOD(3),S_PUT PUT request?
|
2735
|
+
BC B'1000',QS_0430 ... yes, set service name
|
2736
|
+
CLC W_METHOD(6),S_DELETE DELETE request?
|
2737
|
+
BC B'1000',QS_0440 ... yes, set service name
|
2738
|
+
***********************************************************************
|
2739
|
+
* Query Mode POST service program *
|
2740
|
+
***********************************************************************
|
2741
|
+
QS_0410 DS 0H
|
2742
|
+
MVC W_ADDR,FD_GM Move FAxxFD address
|
2743
|
+
MVC W_LENGTH,FD_LEN Move FAxxFD length
|
2744
|
+
MVC W_NAME,C_FAXXFD Move FAxxFD container name
|
2745
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2746
|
+
*
|
2747
|
+
LA R1,R_MEDIA Load media address
|
2748
|
+
ST R1,W_ADDR Save media address
|
2749
|
+
MVC W_LENGTH,L_MEDIA Move media length
|
2750
|
+
MVC W_NAME,C_MEDIA Move media container name
|
2751
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2752
|
+
*
|
2753
|
+
MVC QM_PROG,ZFAM010 Set Query Mode POST program
|
2754
|
+
BC B'1111',QS_0500 Branch to XCTL routine
|
2755
|
+
***********************************************************************
|
2756
|
+
* Query Mode GET service program *
|
2757
|
+
* Use Column Index indicator, which is set to 0 or 1, as the *
|
2758
|
+
* program suffix. The CI indicator is set when a WHERE statement *
|
2759
|
+
* specifies a secondary column index. *
|
2760
|
+
***********************************************************************
|
2761
|
+
QS_0420 DS 0H
|
2762
|
+
BAS R14,QS_0480 Scan PA for column index
|
2763
|
+
*
|
2764
|
+
MVC QM_PROG,ZFAM020 Set Query Mode GET program
|
2765
|
+
MVC QM_PROG+6(1),W_CI Set CI indicator
|
2766
|
+
BC B'1111',QS_0500 Branch to XCTL routine
|
2767
|
+
***********************************************************************
|
2768
|
+
* Query Mode PUT service program *
|
2769
|
+
* *
|
2770
|
+
* Check the fields in the parser array for the following conditions *
|
2771
|
+
* *
|
2772
|
+
* 1). Field larger than 32,000 *
|
2773
|
+
* 2). Field spans a 32,000 byte segment *
|
2774
|
+
* *). Update to a secondary column index *
|
2775
|
+
* *
|
2776
|
+
* If any of these conditions occur for a PUT request, control is *
|
2777
|
+
* transferred to a Query Mode program to handle spanned segment *
|
2778
|
+
* records. *
|
2779
|
+
***********************************************************************
|
2780
|
+
QS_0430 DS 0H
|
2781
|
+
DROP R9 ... tell assemmbler
|
2782
|
+
LA R4,E_PA Load Parser Array entry length
|
2783
|
+
L R5,W_INDEX Load Parser Array index (count)
|
2784
|
+
L R8,PA_GM Load Parser Array address
|
2785
|
+
USING PA_DSECT,R8 ... tell assembler
|
2786
|
+
***********************************************************************
|
2787
|
+
* When a secondary CI is updated, branch to XCTL routine. *
|
2788
|
+
* segments. *
|
2789
|
+
***********************************************************************
|
2790
|
+
QS_0431 DS 0H
|
2791
|
+
XR R6,R6 Clear R6
|
2792
|
+
ZAP W_COLUMN,P_COL Load column number
|
2793
|
+
CVB R7,W_COLUMN Convert column to binary
|
2794
|
+
D R6,=F'32000' Divide column by segment size
|
2795
|
+
* Giving relative segment
|
2796
|
+
XR R6,R6 Clear R6
|
2797
|
+
M R6,=F'32000' Multiply by segment size
|
2798
|
+
* Giving segment displacement
|
2799
|
+
CVB R6,W_COLUMN Convert column to binary
|
2800
|
+
SR R6,R7 Subtract segment displacement
|
2801
|
+
* from column giving
|
2802
|
+
* relative displacement
|
2803
|
+
S R7,=F'1' Make relative to zero
|
2804
|
+
ZAP W_PACK,P_LEN Load field length
|
2805
|
+
CVB R7,W_PACK Convert length to binary
|
2806
|
+
AR R6,R7 Add field length to relative
|
2807
|
+
* displacement giving width
|
2808
|
+
C R6,=F'32000' Width greater than a segment?
|
2809
|
+
BC B'0010',QS_0434 ... branch when spanned segment
|
2810
|
+
*
|
2811
|
+
***********************************************************************
|
2812
|
+
* Point to parser array entry and continue to scan *
|
2813
|
+
***********************************************************************
|
2814
|
+
QS_0432 DS 0H
|
2815
|
+
LA R8,0(R4,R8) Point to next entry
|
2816
|
+
BCT R5,QS_0431 Continue parser array scan
|
2817
|
+
BC B'1111',QS_0433 EOT, no spanned segments
|
2818
|
+
***********************************************************************
|
2819
|
+
* Query Mode PUT service program *
|
2820
|
+
***********************************************************************
|
2821
|
+
QS_0433 DS 0H
|
2822
|
+
MVC QM_PROG,ZFAM030 Set Query Mode PUT program
|
2823
|
+
BC B'1111',QS_0500 Branch to XCTL routine
|
2824
|
+
***********************************************************************
|
2825
|
+
* Query Mode PUT service program for these conditions: *
|
2826
|
+
* Secondary CI updates *
|
2827
|
+
* Updated fields span segments *
|
2828
|
+
***********************************************************************
|
2829
|
+
QS_0434 DS 0H
|
2830
|
+
MVC QM_PROG,ZFAM030 Set Query Mode PUT program
|
2831
|
+
BC B'1111',QS_0500 Branch to XCTL routine
|
2832
|
+
***********************************************************************
|
2833
|
+
* Query Mode DELETE service program *
|
2834
|
+
***********************************************************************
|
2835
|
+
QS_0440 DS 0H
|
2836
|
+
MVC W_ADDR,FD_GM Move FAxxFD address
|
2837
|
+
MVC W_LENGTH,FD_LEN Move FAxxFD length
|
2838
|
+
MVC W_NAME,C_FAXXFD Move FAxxFD container name
|
2839
|
+
BAS R14,PC_0010 Issue PUT CONTAINER
|
2840
|
+
*
|
2841
|
+
MVC QM_PROG,ZFAM040 Set Query Mode DELETE program
|
2842
|
+
BC B'1111',QS_0500 Branch to XCTL routine
|
2843
|
+
***********************************************************************
|
2844
|
+
* Check the fields in the Parser Array for any CI definitions in a *
|
2845
|
+
* WHERE statement. *
|
2846
|
+
***********************************************************************
|
2847
|
+
QS_0480 DS 0H
|
2848
|
+
ST R14,BAS_REG Save return register
|
2849
|
+
*
|
2850
|
+
LA R4,E_PA Load Parser Array entry length
|
2851
|
+
L R5,W_INDEX Load Parser Array index (count)
|
2852
|
+
L R8,PA_GM Load Parser Array address
|
2853
|
+
USING PA_DSECT,R8 ... tell assembler
|
2854
|
+
MVI W_CI,C'0' Set CI indicator off
|
2855
|
+
***********************************************************************
|
2856
|
+
* Check fiels for WHERE indicator and when the field is a secondary *
|
2857
|
+
* column index, mark it. *
|
2858
|
+
***********************************************************************
|
2859
|
+
QS_0481 DS 0H
|
2860
|
+
CLI P_WHERE,C'N' WHERE indicator set?
|
2861
|
+
BC B'1000',QS_0482 ... no, must be a FIELD
|
2862
|
+
CP P_ID,S_ONE_PD Primary CI or field?
|
2863
|
+
BC B'1100',QS_0482 ... yes, continue
|
2864
|
+
MVI W_CI,C'1' Set CI indicator on
|
2865
|
+
***********************************************************************
|
2866
|
+
* Point to parser array entry and continue to scan *
|
2867
|
+
***********************************************************************
|
2868
|
+
QS_0482 DS 0H
|
2869
|
+
LA R8,0(R4,R8) Point to next entry
|
2870
|
+
BCT R5,QS_0481 Continue parser array scan
|
2871
|
+
CLI W_CI,C'1' Secondary CI indicator set?
|
2872
|
+
BC B'0100',QS_0489 ... no, bypass HTTP header
|
2873
|
+
*
|
2874
|
+
***********************************************************************
|
2875
|
+
* Read HTTPHEADER for zFAM-Stream option. *
|
2876
|
+
***********************************************************************
|
2877
|
+
QS_0483 DS 0H
|
2878
|
+
LA R1,Z_LENGTH Load header name length
|
2879
|
+
ST R1,L_HEADER Save header name length
|
2880
|
+
LA R1,Z_VAL_L Load value field length
|
2881
|
+
ST R1,V_LENGTH Save value field length
|
2882
|
+
*
|
2883
|
+
EXEC CICS WEB READ HTTPHEADER(Z_HEADER) X
|
2884
|
+
NAMELENGTH(L_HEADER) X
|
2885
|
+
VALUE(Z_VALUE) X
|
2886
|
+
VALUELENGTH(V_LENGTH) X
|
2887
|
+
NOHANDLE
|
2888
|
+
*
|
2889
|
+
***********************************************************************
|
2890
|
+
* Set program suffix for zFAM022, which will process WHERE requests *
|
2891
|
+
* with secondary column indexes as the first field in the statement. *
|
2892
|
+
**********************************************************************
|
2893
|
+
MVI W_CI,C'2' Set zFAM022 program suffix
|
2894
|
+
***********************************************************************
|
2895
|
+
* Return to calling routine. *
|
2896
|
+
***********************************************************************
|
2897
|
+
QS_0489 DS 0H
|
2898
|
+
L R14,BAS_REG Load return register
|
2899
|
+
BCR B'1111',R14 Return to caller
|
2900
|
+
*
|
2901
|
+
***********************************************************************
|
2902
|
+
* Transfer control (XCTL) to Query mode process *
|
2903
|
+
***********************************************************************
|
2904
|
+
QS_0500 DS 0H
|
2905
|
+
EXEC CICS XCTL PROGRAM(QM_PROG) X
|
2906
|
+
CHANNEL(C_CHAN) X
|
2907
|
+
NOHANDLE
|
2908
|
+
BC B'1111',ER_50002 Houston, we have a problem
|
2909
|
+
*
|
2910
|
+
***********************************************************************
|
2911
|
+
* Return to caller *
|
2912
|
+
**********************************************************************
|
2913
|
+
RETURN DS 0H
|
2914
|
+
EXEC CICS RETURN
|
2915
|
+
*
|
2916
|
+
***********************************************************************
|
2917
|
+
* Issue TRACE command. *
|
2918
|
+
***********************************************************************
|
2919
|
+
TR_0010 DS 0H
|
2920
|
+
ST R14,BAS_REG Save return register
|
2921
|
+
*
|
2922
|
+
EXEC CICS ENTER TRACENUM(T_46) X
|
2923
|
+
FROM(T_46_M) X
|
2924
|
+
FROMLENGTH(T_LEN) X
|
2925
|
+
RESOURCE(T_RES) X
|
2926
|
+
NOHANDLE
|
2927
|
+
*
|
2928
|
+
L R14,BAS_REG Load return register
|
2929
|
+
BCR B'1111',R14 Return to caller
|
2930
|
+
*
|
2931
|
+
***********************************************************************
|
2932
|
+
* Issue PUT CONTAINER for various artifacts. *
|
2933
|
+
* Note: Artifacts is a cool 'architect' buzz term, which according *
|
2934
|
+
* to Thesaurus means objects, articles, items, things, pieces, *
|
2935
|
+
* relics, etc. Not sure why architects use such big words. I *
|
2936
|
+
* had to look this up to see what 'artifacts' really means. *
|
2937
|
+
***********************************************************************
|
2938
|
+
PC_0010 DS 0H
|
2939
|
+
ST R14,BAS_REG Save return register
|
2940
|
+
L R6,W_ADDR Load field data address
|
2941
|
+
USING DC_DSECT,R6 ... tell assembler
|
2942
|
+
EXEC CICS PUT CONTAINER(W_NAME) X
|
2943
|
+
FROM(DC_DSECT) X
|
2944
|
+
FLENGTH(W_LENGTH) X
|
2945
|
+
CHANNEL(C_CHAN) X
|
2946
|
+
NOHANDLE
|
2947
|
+
L R14,BAS_REG Load return register
|
2948
|
+
BCR B'1111',R14 Return to caller
|
2949
|
+
*
|
2950
|
+
***********************************************************************
|
2951
|
+
* Parse DFHCOMMAREA to find query string on POST/PUT requests *
|
2952
|
+
* This routine will only be called when the EXTRACT command receives *
|
2953
|
+
* a QUERYSTRLEN between 3 and 8192 bytes. *
|
2954
|
+
***********************************************************************
|
2955
|
+
CA_0010 DS 0H
|
2956
|
+
ST R14,BAS_REG Save return register
|
2957
|
+
LH R4,EIBCALEN Load DFHCOMMAREA length
|
2958
|
+
L R5,DFHEICAP Load DFHCOMMAREA address
|
2959
|
+
***********************************************************************
|
2960
|
+
* Query string begins with '?'. *
|
2961
|
+
***********************************************************************
|
2962
|
+
CA_0020 DS 0H
|
2963
|
+
CLI 0(R5),C'?' Query string?
|
2964
|
+
BC B'1000',CA_0030 ... yes, save the address
|
2965
|
+
LA R5,1(,R5) Point to next byte
|
2966
|
+
BCT R4,CA_0020 Continue QS search
|
2967
|
+
BC B'1111',ER_40010 Malformed syntax
|
2968
|
+
***********************************************************************
|
2969
|
+
* Point past '?' to first byte of query string *
|
2970
|
+
***********************************************************************
|
2971
|
+
CA_0030 DS 0H
|
2972
|
+
LA R5,1(,R5) Point to next byte
|
2973
|
+
ST R5,QS_ADDR Save Query String address
|
2974
|
+
L R14,BAS_REG Load return register
|
2975
|
+
BCR B'1111',R14 Return to calling routine
|
2976
|
+
*
|
2977
|
+
***********************************************************************
|
2978
|
+
* Transfer control (XCTL) to Logging program. *
|
2979
|
+
***********************************************************************
|
2980
|
+
ER_XCTL DS 0H
|
2981
|
+
STM R0,R15,REGSAVE Save registers
|
2982
|
+
LA R1,E_LOG Load COMMAREA length
|
2983
|
+
STH R1,L_LOG Save COMMAREA length
|
2984
|
+
*
|
2985
|
+
EXEC CICS XCTL PROGRAM(ZFAM090) X
|
2986
|
+
COMMAREA(C_LOG) X
|
2987
|
+
LENGTH(L_LOG) X
|
2988
|
+
NOHANDLE
|
2989
|
+
*
|
2990
|
+
EXEC CICS WEB SEND X
|
2991
|
+
FROM (H_CRLF) X
|
2992
|
+
FROMLENGTH(H_TWO) X
|
2993
|
+
ACTION (H_ACTION) X
|
2994
|
+
MEDIATYPE (H_MEDIA) X
|
2995
|
+
STATUSCODE(H_STAT) X
|
2996
|
+
STATUSTEXT(H_TEXT) X
|
2997
|
+
STATUSLEN (H_LEN) X
|
2998
|
+
SRVCONVERT X
|
2999
|
+
NOHANDLE
|
3000
|
+
*
|
3001
|
+
BC B'1111',RETURN Return (if XCTL fails)
|
3002
|
+
*
|
3003
|
+
***********************************************************************
|
3004
|
+
* STATUS(400) RETURN CODE(01) *
|
3005
|
+
***********************************************************************
|
3006
|
+
ER_40001 DS 0H
|
3007
|
+
MVC C_STATUS,S_400 Set STATUS
|
3008
|
+
MVC C_REASON,=C'01' Set REASON
|
3009
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3010
|
+
***********************************************************************
|
3011
|
+
* STATUS(400) RETURN CODE(02) *
|
3012
|
+
***********************************************************************
|
3013
|
+
ER_40002 DS 0H
|
3014
|
+
MVC C_STATUS,S_400 Set STATUS
|
3015
|
+
MVC C_REASON,=C'02' Set REASON
|
3016
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3017
|
+
***********************************************************************
|
3018
|
+
* STATUS(400) RETURN CODE(03) *
|
3019
|
+
***********************************************************************
|
3020
|
+
ER_40003 DS 0H
|
3021
|
+
MVC C_STATUS,S_400 Set STATUS
|
3022
|
+
MVC C_REASON,=C'03' Set REASON
|
3023
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3024
|
+
***********************************************************************
|
3025
|
+
* STATUS(400) RETURN CODE(04) *
|
3026
|
+
***********************************************************************
|
3027
|
+
ER_40004 DS 0H
|
3028
|
+
MVC C_STATUS,S_400 Set STATUS
|
3029
|
+
MVC C_REASON,=C'04' Set REASON
|
3030
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3031
|
+
***********************************************************************
|
3032
|
+
* STATUS(400) RETURN CODE(05) *
|
3033
|
+
***********************************************************************
|
3034
|
+
ER_40005 DS 0H
|
3035
|
+
MVC C_STATUS,S_400 Set STATUS
|
3036
|
+
MVC C_REASON,=C'05' Set REASON
|
3037
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3038
|
+
***********************************************************************
|
3039
|
+
* STATUS(400) RETURN CODE(06) *
|
3040
|
+
***********************************************************************
|
3041
|
+
ER_40006 DS 0H
|
3042
|
+
MVC C_STATUS,S_400 Set STATUS
|
3043
|
+
MVC C_REASON,=C'06' Set REASON
|
3044
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3045
|
+
***********************************************************************
|
3046
|
+
* STATUS(400) RETURN CODE(07) *
|
3047
|
+
***********************************************************************
|
3048
|
+
ER_40007 DS 0H
|
3049
|
+
MVC C_STATUS,S_400 Set STATUS
|
3050
|
+
MVC C_REASON,=C'07' Set REASON
|
3051
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3052
|
+
***********************************************************************
|
3053
|
+
* STATUS(400) RETURN CODE(08) *
|
3054
|
+
***********************************************************************
|
3055
|
+
ER_40008 DS 0H
|
3056
|
+
MVC C_STATUS,S_400 Set STATUS
|
3057
|
+
MVC C_REASON,=C'08' Set REASON
|
3058
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3059
|
+
***********************************************************************
|
3060
|
+
* STATUS(400) RETURN CODE(09) *
|
3061
|
+
***********************************************************************
|
3062
|
+
ER_40009 DS 0H
|
3063
|
+
MVC C_STATUS,S_400 Set STATUS
|
3064
|
+
MVC C_REASON,=C'09' Set REASON
|
3065
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3066
|
+
***********************************************************************
|
3067
|
+
* STATUS(400) RETURN CODE(10) *
|
3068
|
+
***********************************************************************
|
3069
|
+
ER_40010 DS 0H
|
3070
|
+
MVC C_STATUS,S_400 Set STATUS
|
3071
|
+
MVC C_REASON,=C'10' Set REASON
|
3072
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3073
|
+
***********************************************************************
|
3074
|
+
* STATUS(401) RETURN CODE(01) *
|
3075
|
+
***********************************************************************
|
3076
|
+
ER_40101 DS 0H
|
3077
|
+
MVC C_STATUS,S_401 Set STATUS
|
3078
|
+
MVC C_REASON,=C'01' Set REASON
|
3079
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3080
|
+
***********************************************************************
|
3081
|
+
* STATUS(401) RETURN CODE(02) *
|
3082
|
+
***********************************************************************
|
3083
|
+
ER_40102 DS 0H
|
3084
|
+
MVC C_STATUS,S_401 Set STATUS
|
3085
|
+
MVC C_REASON,=C'02' Set REASON
|
3086
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3087
|
+
***********************************************************************
|
3088
|
+
* STATUS(401) RETURN CODE(03) *
|
3089
|
+
***********************************************************************
|
3090
|
+
ER_40103 DS 0H
|
3091
|
+
MVC C_STATUS,S_401 Set STATUS
|
3092
|
+
MVC C_REASON,=C'03' Set REASON
|
3093
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3094
|
+
***********************************************************************
|
3095
|
+
* STATUS(401) RETURN CODE(04) *
|
3096
|
+
***********************************************************************
|
3097
|
+
ER_40104 DS 0H
|
3098
|
+
MVC C_STATUS,S_401 Set STATUS
|
3099
|
+
MVC C_REASON,=C'04' Set REASON
|
3100
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3101
|
+
***********************************************************************
|
3102
|
+
* STATUS(401) RETURN CODE(05) *
|
3103
|
+
***********************************************************************
|
3104
|
+
ER_40105 DS 0H
|
3105
|
+
MVC C_STATUS,S_401 Set STATUS
|
3106
|
+
MVC C_REASON,=C'05' Set REASON
|
3107
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3108
|
+
***********************************************************************
|
3109
|
+
* STATUS(401) RETURN CODE(06) *
|
3110
|
+
***********************************************************************
|
3111
|
+
ER_40106 DS 0H
|
3112
|
+
MVC C_STATUS,S_401 Set STATUS
|
3113
|
+
MVC C_REASON,=C'06' Set REASON
|
3114
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3115
|
+
***********************************************************************
|
3116
|
+
* STATUS(401) RETURN CODE(07) *
|
3117
|
+
***********************************************************************
|
3118
|
+
ER_40107 DS 0H
|
3119
|
+
MVC C_STATUS,S_401 Set STATUS
|
3120
|
+
MVC C_REASON,=C'07' Set REASON
|
3121
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3122
|
+
***********************************************************************
|
3123
|
+
* STATUS(401) RETURN CODE(08) *
|
3124
|
+
***********************************************************************
|
3125
|
+
ER_40108 DS 0H
|
3126
|
+
MVC C_STATUS,S_401 Set STATUS
|
3127
|
+
MVC C_REASON,=C'08' Set REASON
|
3128
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3129
|
+
***********************************************************************
|
3130
|
+
* STATUS(401) RETURN CODE(09) *
|
3131
|
+
***********************************************************************
|
3132
|
+
ER_40109 DS 0H
|
3133
|
+
MVC C_STATUS,S_401 Set STATUS
|
3134
|
+
MVC C_REASON,=C'09' Set REASON
|
3135
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3136
|
+
***********************************************************************
|
3137
|
+
* STATUS(401) RETURN CODE(10) *
|
3138
|
+
***********************************************************************
|
3139
|
+
ER_40110 DS 0H
|
3140
|
+
MVC C_STATUS,S_401 Set STATUS
|
3141
|
+
MVC C_REASON,=C'10' Set REASON
|
3142
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3143
|
+
***********************************************************************
|
3144
|
+
* STATUS(401) RETURN CODE(11) *
|
3145
|
+
***********************************************************************
|
3146
|
+
ER_40111 DS 0H
|
3147
|
+
MVC C_STATUS,S_401 Set STATUS
|
3148
|
+
MVC C_REASON,=C'11' Set REASON
|
3149
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3150
|
+
***********************************************************************
|
3151
|
+
* STATUS(401) RETURN CODE(12) *
|
3152
|
+
***********************************************************************
|
3153
|
+
ER_40112 DS 0H
|
3154
|
+
MVC C_STATUS,S_401 Set STATUS
|
3155
|
+
MVC C_REASON,=C'12' Set REASON
|
3156
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3157
|
+
***********************************************************************
|
3158
|
+
* STATUS(401) RETURN CODE(13) *
|
3159
|
+
***********************************************************************
|
3160
|
+
ER_40113 DS 0H
|
3161
|
+
MVC C_STATUS,S_401 Set STATUS
|
3162
|
+
MVC C_REASON,=C'13' Set REASON
|
3163
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3164
|
+
***********************************************************************
|
3165
|
+
* STATUS(401) RETURN CODE(14) *
|
3166
|
+
***********************************************************************
|
3167
|
+
ER_40114 DS 0H
|
3168
|
+
MVC C_STATUS,S_401 Set STATUS
|
3169
|
+
MVC C_REASON,=C'14' Set REASON
|
3170
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3171
|
+
***********************************************************************
|
3172
|
+
* STATUS(405) RETURN CODE(01) *
|
3173
|
+
***********************************************************************
|
3174
|
+
ER_40501 DS 0H
|
3175
|
+
MVC C_STATUS,S_405 Set STATUS
|
3176
|
+
MVC C_REASON,=C'01' Set REASON
|
3177
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3178
|
+
***********************************************************************
|
3179
|
+
* STATUS(402) RETURN CODE(02) *
|
3180
|
+
***********************************************************************
|
3181
|
+
ER_40502 DS 0H
|
3182
|
+
MVC C_STATUS,S_405 Set STATUS
|
3183
|
+
MVC C_REASON,=C'02' Set REASON
|
3184
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3185
|
+
***********************************************************************
|
3186
|
+
* STATUS(403) RETURN CODE(01) *
|
3187
|
+
***********************************************************************
|
3188
|
+
ER_40503 DS 0H
|
3189
|
+
MVC C_STATUS,S_405 Set STATUS
|
3190
|
+
MVC C_REASON,=C'03' Set REASON
|
3191
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3192
|
+
***********************************************************************
|
3193
|
+
* STATUS(404) RETURN CODE(01) *
|
3194
|
+
***********************************************************************
|
3195
|
+
ER_40504 DS 0H
|
3196
|
+
MVC C_STATUS,S_405 Set STATUS
|
3197
|
+
MVC C_REASON,=C'04' Set REASON
|
3198
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3199
|
+
***********************************************************************
|
3200
|
+
* STATUS(405) RETURN CODE(05) *
|
3201
|
+
***********************************************************************
|
3202
|
+
ER_40505 DS 0H
|
3203
|
+
MVC C_STATUS,S_405 Set STATUS
|
3204
|
+
MVC C_REASON,=C'05' Set REASON
|
3205
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3206
|
+
***********************************************************************
|
3207
|
+
* STATUS(411) RETURN CODE(01) *
|
3208
|
+
***********************************************************************
|
3209
|
+
ER_41101 DS 0H
|
3210
|
+
MVC C_STATUS,S_411 Set STATUS
|
3211
|
+
MVC C_REASON,=C'01' Set REASON
|
3212
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3213
|
+
***********************************************************************
|
3214
|
+
* STATUS(412) RETURN CODE(01) *
|
3215
|
+
***********************************************************************
|
3216
|
+
ER_41201 DS 0H
|
3217
|
+
MVC C_STATUS,S_412 Set STATUS
|
3218
|
+
MVC C_REASON,=C'01' Set REASON
|
3219
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3220
|
+
***********************************************************************
|
3221
|
+
* STATUS(412) RETURN CODE(02) *
|
3222
|
+
***********************************************************************
|
3223
|
+
ER_41202 DS 0H
|
3224
|
+
MVC C_STATUS,S_412 Set STATUS
|
3225
|
+
MVC C_REASON,=C'02' Set REASON
|
3226
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3227
|
+
***********************************************************************
|
3228
|
+
* STATUS(412) RETURN CODE(03) *
|
3229
|
+
***********************************************************************
|
3230
|
+
ER_41203 DS 0H
|
3231
|
+
MVC C_STATUS,S_412 Set STATUS
|
3232
|
+
MVC C_REASON,=C'03' Set REASON
|
3233
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3234
|
+
***********************************************************************
|
3235
|
+
* STATUS(413) RETURN CODE(01) *
|
3236
|
+
***********************************************************************
|
3237
|
+
ER_41301 DS 0H
|
3238
|
+
MVC C_STATUS,S_413 Set STATUS
|
3239
|
+
MVC C_REASON,=C'01' Set REASON
|
3240
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3241
|
+
***********************************************************************
|
3242
|
+
* STATUS(414) RETURN CODE(01) *
|
3243
|
+
***********************************************************************
|
3244
|
+
ER_41401 DS 0H
|
3245
|
+
MVC C_STATUS,S_414 Set STATUS
|
3246
|
+
MVC C_REASON,=C'01' Set REASON
|
3247
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3248
|
+
***********************************************************************
|
3249
|
+
* STATUS(414) RETURN CODE(02) *
|
3250
|
+
***********************************************************************
|
3251
|
+
ER_41402 DS 0H
|
3252
|
+
MVC C_STATUS,S_414 Set STATUS
|
3253
|
+
MVC C_REASON,=C'02' Set REASON
|
3254
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3255
|
+
***********************************************************************
|
3256
|
+
* STATUS(414) RETURN CODE(03) *
|
3257
|
+
***********************************************************************
|
3258
|
+
ER_41403 DS 0H
|
3259
|
+
MVC C_STATUS,S_414 Set STATUS
|
3260
|
+
MVC C_REASON,=C'03' Set REASON
|
3261
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3262
|
+
***********************************************************************
|
3263
|
+
* STATUS(414) RETURN CODE(04) *
|
3264
|
+
***********************************************************************
|
3265
|
+
ER_41404 DS 0H
|
3266
|
+
MVC C_STATUS,S_414 Set STATUS
|
3267
|
+
MVC C_REASON,=C'04' Set REASON
|
3268
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3269
|
+
***********************************************************************
|
3270
|
+
* STATUS(414) RETURN CODE(05) *
|
3271
|
+
***********************************************************************
|
3272
|
+
ER_41405 DS 0H
|
3273
|
+
MVC C_STATUS,S_414 Set STATUS
|
3274
|
+
MVC C_REASON,=C'05' Set REASON
|
3275
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3276
|
+
***********************************************************************
|
3277
|
+
* STATUS(414) RETURN CODE(06) *
|
3278
|
+
***********************************************************************
|
3279
|
+
ER_41406 DS 0H
|
3280
|
+
MVC C_STATUS,S_414 Set STATUS
|
3281
|
+
MVC C_REASON,=C'06' Set REASON
|
3282
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3283
|
+
***********************************************************************
|
3284
|
+
* STATUS(414) RETURN CODE(07) *
|
3285
|
+
***********************************************************************
|
3286
|
+
ER_41407 DS 0H
|
3287
|
+
MVC C_STATUS,S_414 Set STATUS
|
3288
|
+
MVC C_REASON,=C'07' Set REASON
|
3289
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3290
|
+
***********************************************************************
|
3291
|
+
* STATUS(500) RETURN CODE(01) *
|
3292
|
+
***********************************************************************
|
3293
|
+
ER_50001 DS 0H
|
3294
|
+
MVC C_STATUS,S_500 Set STATUS
|
3295
|
+
MVC C_REASON,=C'01' Set REASON
|
3296
|
+
MVC C_PROG,BM_PROG Set Basic Mode program name
|
3297
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3298
|
+
***********************************************************************
|
3299
|
+
* STATUS(500) RETURN CODE(02) *
|
3300
|
+
***********************************************************************
|
3301
|
+
ER_50002 DS 0H
|
3302
|
+
MVC C_STATUS,S_500 Set STATUS
|
3303
|
+
MVC C_REASON,=C'02' Set REASON
|
3304
|
+
MVC C_PROG,QM_PROG Set Query Mode program name
|
3305
|
+
BC B'1111',ER_XCTL Transfer control to logging
|
3306
|
+
*
|
3307
|
+
***********************************************************************
|
3308
|
+
* Define Constant fields *
|
3309
|
+
***********************************************************************
|
3310
|
+
*
|
3311
|
+
DS 0F
|
3312
|
+
DECODE DC V(ZDECODE) ZDECODE subroutine
|
3313
|
+
DS 0F
|
3314
|
+
REPLIC8 DC CL10'/replicate' zFAM replication
|
3315
|
+
URI_DS DC CL10'/datastore' datastore URI
|
3316
|
+
DS 0H
|
3317
|
+
FA_PRE DC CL02'FA' zFAM transaction prefix
|
3318
|
+
HEX_00 DC XL01'00' Nulls
|
3319
|
+
DS 0F
|
3320
|
+
HEX_40 DC 16XL01'40' Spaces
|
3321
|
+
DS 0F
|
3322
|
+
ZQL DC CL03'ZQL' zQL query string
|
3323
|
+
DS 0F
|
3324
|
+
S_400 DC CL03'400' HTTP STATUS(400)
|
3325
|
+
DS 0F
|
3326
|
+
S_401 DC CL03'401' HTTP STATUS(401)
|
3327
|
+
DS 0F
|
3328
|
+
S_403 DC CL03'403' HTTP STATUS(403)
|
3329
|
+
DS 0F
|
3330
|
+
S_405 DC CL03'405' HTTP STATUS(405)
|
3331
|
+
DS 0F
|
3332
|
+
S_411 DC CL03'411' HTTP STATUS(411)
|
3333
|
+
DS 0F
|
3334
|
+
S_412 DC CL03'412' HTTP STATUS(412)
|
3335
|
+
DS 0F
|
3336
|
+
S_413 DC CL03'413' HTTP STATUS(413)
|
3337
|
+
DS 0F
|
3338
|
+
S_414 DC CL03'414' HTTP STATUS(414)
|
3339
|
+
DS 0F
|
3340
|
+
S_500 DC CL03'500' HTTP STATUS(500)
|
3341
|
+
DS 0F
|
3342
|
+
ONE DC F'00001' One
|
3343
|
+
SIX DC F'00006' Six
|
3344
|
+
SD_GM_L DC F'16384' FAxxSD GETMAIN length
|
3345
|
+
FD_GM_L DC F'68000' FAxxFD GETMAIN length
|
3346
|
+
PA_GM_L DC F'8192' Parser array length
|
3347
|
+
MAX_QS DC F'8192' Query String maximum length
|
3348
|
+
MAX_PA DC F'256' Parser array maximum entries
|
3349
|
+
MAX_LEN DC F'64000' Field data maximum length
|
3350
|
+
S_WR_LEN DC F'3200000' Set maximum receive length
|
3351
|
+
DS 0F
|
3352
|
+
S_ONE_PD DC PL2'1' Packed decimal one
|
3353
|
+
S_ZEROPD DC PL4'0' Packed decimal zeroes
|
3354
|
+
S_32K DC PL4'32000' Packed decimal 32,000
|
3355
|
+
DS 0F
|
3356
|
+
ZBASIC DC CL08'ZBASIC ' zBASIC Basic Authentication
|
3357
|
+
ZFAM002 DC CL08'ZFAM002 ' Basic mode
|
3358
|
+
ZFAM010 DC CL08'ZFAM010 ' Query mode POST
|
3359
|
+
ZFAM011 DC CL08'ZFAM011 ' Basic mode POST (CI defined)
|
3360
|
+
ZFAM020 DC CL08'ZFAM020 ' Query mode GET
|
3361
|
+
ZFAM021 DC CL08'ZFAM021 ' Query mode GET (not used)
|
3362
|
+
ZFAM022 DC CL08'ZFAM022 ' Query mode GET (CI requested)
|
3363
|
+
ZFAM030 DC CL08'ZFAM030 ' Query mode PUT
|
3364
|
+
ZFAM031 DC CL08'ZFAM031 ' Basic mode PUT (CI defined)
|
3365
|
+
ZFAM040 DC CL08'ZFAM040 ' Query mode DELETE
|
3366
|
+
ZFAM041 DC CL08'ZFAM041 ' Basic mode DELETE (CI defined)
|
3367
|
+
ZFAM090 DC CL08'ZFAM090 ' Logging program for zFAM001
|
3368
|
+
*
|
3369
|
+
DS 0F
|
3370
|
+
S_YEA DC CL03'YEA' Read Only enabled
|
3371
|
+
DS 0F
|
3372
|
+
S_NAY DC CL03'NAY' Read Only disabled
|
3373
|
+
*
|
3374
|
+
DS 0F
|
3375
|
+
S_FIELDS DC CL06'FIELDS' FIELDS command
|
3376
|
+
DS 0F
|
3377
|
+
S_WHERE DC CL05'WHERE' WHERE command
|
3378
|
+
DS 0F
|
3379
|
+
S_VIEW DC CL04'VIEW' VIEW command
|
3380
|
+
DS 0F
|
3381
|
+
S_WITH DC CL04'WITH' WITH command
|
3382
|
+
DS 0F
|
3383
|
+
S_AND DC CL03'AND' AND command
|
3384
|
+
DS 0F
|
3385
|
+
S_TTL DC CL03'TTL' TTL command
|
3386
|
+
DS 0F
|
3387
|
+
S_GET DC CL06'GET ' GET request
|
3388
|
+
DS 0F
|
3389
|
+
S_SELECT DC CL06'SELECT' SELECT request
|
3390
|
+
DS 0F
|
3391
|
+
S_PUT DC CL06'PUT ' PUT request
|
3392
|
+
DS 0F
|
3393
|
+
S_UPDATE DC CL06'UPDATE' UPDATE request
|
3394
|
+
DS 0F
|
3395
|
+
S_POST DC CL06'POST ' POST request
|
3396
|
+
DS 0F
|
3397
|
+
S_INSERT DC CL06'INSERT' INSERT request
|
3398
|
+
DS 0F
|
3399
|
+
S_DELETE DC CL06'DELETE' DELETE request
|
3400
|
+
* DELETE security type
|
3401
|
+
DS 0F
|
3402
|
+
S_READ DC CL06'READ ' READ security type
|
3403
|
+
DS 0F
|
3404
|
+
S_WRITE DC CL06'WRITE ' WRITE security type
|
3405
|
+
DS 0F
|
3406
|
+
S_OPTION DC CL07'OPTIONS' OPTIONS command
|
3407
|
+
DS 0F
|
3408
|
+
S_CR DC CL02'CR' WITH CR (Committed Reads)
|
3409
|
+
DS 0F
|
3410
|
+
S_UR DC CL02'UR' WITH UR (Uncommitted Reads)
|
3411
|
+
* Default OPTION WITH
|
3412
|
+
DS 0F
|
3413
|
+
S_FORMAT DC CL06'FORMAT' OPTION FORMAT
|
3414
|
+
DS 0F
|
3415
|
+
S_DIST DC CL08'DISTINCT' OPTION DISTINCT
|
3416
|
+
DS 0F
|
3417
|
+
S_MODE DC CL04'MODE' OPTION MODE
|
3418
|
+
DS 0F
|
3419
|
+
S_SORT DC CL04'SORT' OPTION SORT
|
3420
|
+
DS 0F
|
3421
|
+
S_ROWS DC CL04'ROWS' OPTION ROWS
|
3422
|
+
DS 0F
|
3423
|
+
S_FIXED DC CL09'FIXED ' OPTION FORMAT (default)
|
3424
|
+
DS 0F
|
3425
|
+
S_XML DC CL09'XML ' OPTION FORMAT
|
3426
|
+
DS 0F
|
3427
|
+
S_JSON DC CL09'JSON ' OPTION FORMAT
|
3428
|
+
DS 0F
|
3429
|
+
S_DELIM DC CL09'DELIMITER' OPTION FORMAT
|
3430
|
+
DS 0F
|
3431
|
+
S_NO DC CL02'NO' OPTION DISTINCT (default)
|
3432
|
+
DS 0F
|
3433
|
+
S_YES DC CL03'YES' OPTION DISTINCT
|
3434
|
+
*
|
3435
|
+
DS 0F
|
3436
|
+
S_ON DC CL08'ONLINE ' OPTION MODE (default)
|
3437
|
+
DS 0F
|
3438
|
+
S_OFF DC CL08'OFFLINE ' OPTION MODE
|
3439
|
+
DS 0F
|
3440
|
+
S_ZEROES DC CL06'000000' OPTION ROWS (default)
|
3441
|
+
DS 0F
|
3442
|
+
*
|
3443
|
+
DS 0F
|
3444
|
+
A_HEADER DC CL13'Authorization' HTTP Header (Authorization)
|
3445
|
+
A_LENGTH EQU *-A_HEADER HTTP header field length
|
3446
|
+
DS 0F
|
3447
|
+
Z_HEADER DC CL11'zFAM-Stream' HTTP header (zFAM-Stream)
|
3448
|
+
Z_LENGTH EQU *-Z_HEADER HTTP header field length
|
3449
|
+
DS 0F
|
3450
|
+
M_ACAO_L DC F'01' HTTP value length
|
3451
|
+
M_ACAO DC CL01'*' HTTP value field
|
3452
|
+
H_ACAO_L DC F'27' HTTP header length
|
3453
|
+
H_ACAO DC CL16'Access-Control-A' HTTP header field
|
3454
|
+
DC CL11'llow-Origin' HTTP header field
|
3455
|
+
DS 0F
|
3456
|
+
C_CHAN DC CL16'ZFAM-CHANNEL ' zFAM channel
|
3457
|
+
C_OPTION DC CL16'ZFAM-OPTIONS ' OPTIONS container
|
3458
|
+
C_TTL DC CL16'ZFAM-TTL ' TTL container
|
3459
|
+
C_ARRAY DC CL16'ZFAM-ARRAY ' ARRAY container
|
3460
|
+
C_FAXXFD DC CL16'ZFAM-FAXXFD ' Field Description document
|
3461
|
+
C_KEY DC CL16'ZFAM-KEY ' Primary CI key
|
3462
|
+
C_MEDIA DC CL16'ZFAM-MEDIA ' Media type
|
3463
|
+
DS 0F
|
3464
|
+
***********************************************************************
|
3465
|
+
* Trace resources *
|
3466
|
+
***********************************************************************
|
3467
|
+
T_46 DC H'46' Trace number
|
3468
|
+
T_46_M DC CL08'OBJECTS ' Trace message
|
3469
|
+
T_RES DC CL08'zFAM001 ' Trace resource
|
3470
|
+
T_LEN DC H'08' Trace resource length
|
3471
|
+
***********************************************************************
|
3472
|
+
* Internal error resources *
|
3473
|
+
***********************************************************************
|
3474
|
+
H_TWO DC F'2' Length of CRLF
|
3475
|
+
H_CRLF DC XL02'0D25' Carriage Return Line Feed
|
3476
|
+
H_STAT DC H'500' HTTP STATUS(500)
|
3477
|
+
H_ACTION DC F'02' HTTP SEND ACTION(IMMEDIATE)
|
3478
|
+
H_LEN DC F'48' HTTP STATUS TEXT Length
|
3479
|
+
H_TEXT DC CL16'03-001 Service u' HTTP STATUS TEXT Length
|
3480
|
+
DC CL16'navailable and l' ... continued
|
3481
|
+
DC CL16'ogging disabled ' ... and complete
|
3482
|
+
H_MEDIA DC CL56'text/plain' HTTP Media type
|
3483
|
+
DS 0F
|
3484
|
+
L_MEDIA DC F'00056' Media type length
|
3485
|
+
DS 0F
|
3486
|
+
*
|
3487
|
+
***********************************************************************
|
3488
|
+
* Literal Pool *
|
3489
|
+
***********************************************************************
|
3490
|
+
LTORG
|
3491
|
+
*
|
3492
|
+
***********************************************************************
|
3493
|
+
* Communication area between zFAM001 and ZDECODE *
|
3494
|
+
***********************************************************************
|
3495
|
+
ZFAM_CA DSECT
|
3496
|
+
ZD_RC DS CL02 Return Code
|
3497
|
+
DS CL02 not used (alignment)
|
3498
|
+
ZD_USER DS CL08 UserID
|
3499
|
+
ZD_PASS DS CL08 Password
|
3500
|
+
ZD_ENC DS CL24 Encoded field (max 24 bytes)
|
3501
|
+
DS CL04 not used (alignment)
|
3502
|
+
ZD_DEC DS CL18 Decoded field (max 18 byte)
|
3503
|
+
ZD_L EQU *-ZD_RC ZFAM_CA length
|
3504
|
+
*
|
3505
|
+
*
|
3506
|
+
***********************************************************************
|
3507
|
+
* Control Section - ZDECODE *
|
3508
|
+
***********************************************************************
|
3509
|
+
ZDECODE AMODE 31
|
3510
|
+
ZDECODE RMODE 31
|
3511
|
+
ZDECODE CSECT
|
3512
|
+
***********************************************************************
|
3513
|
+
* Establish addressibility *
|
3514
|
+
***********************************************************************
|
3515
|
+
ZD_0010 DS 0H
|
3516
|
+
STM R14,R12,12(R13) Save registers
|
3517
|
+
LR R10,R15 Load base register
|
3518
|
+
USING ZDECODE,R10 ... tell assembler
|
3519
|
+
LR R9,R1 Load work area address
|
3520
|
+
USING ZFAM_CA,R9 ... tell assembler
|
3521
|
+
B ZD_DATE Branch around literals
|
3522
|
+
DC CL08'ZDECODE '
|
3523
|
+
DC CL48' -- Base64Binary decode Basic Authentication '
|
3524
|
+
DC CL08' '
|
3525
|
+
DC CL08'&SYSDATE'
|
3526
|
+
DC CL08' '
|
3527
|
+
DC CL08'&SYSTIME'
|
3528
|
+
ZD_DATE DS 0H
|
3529
|
+
***********************************************************************
|
3530
|
+
* Decode Base64Binary UserID:Password *
|
3531
|
+
***********************************************************************
|
3532
|
+
ZD_0020 DS 0H
|
3533
|
+
MVC ZD_DEC,ASCII_20 Initialize to ASCII spaces
|
3534
|
+
LA R2,6 Load Octet count
|
3535
|
+
LA R3,ZD_ENC Address encoded field (source)
|
3536
|
+
LA R6,ZD_DEC Address decoded field (target)
|
3537
|
+
*
|
3538
|
+
***********************************************************************
|
3539
|
+
* Process six octets *
|
3540
|
+
* R4 and R5 are used as the even/odd pair registers for SLL and SLDL *
|
3541
|
+
* instructions. *
|
3542
|
+
***********************************************************************
|
3543
|
+
ZD_0030 DS 0H
|
3544
|
+
SR R4,R4 Clear R4
|
3545
|
+
SR R5,R5 Clear R5
|
3546
|
+
*
|
3547
|
+
BAS R14,ZD_1000 Decode four bytes into three
|
3548
|
+
BCT R2,ZD_0030 ... for each octet
|
3549
|
+
***********************************************************************
|
3550
|
+
* At this point, the UserID:Password has been decoded and converted *
|
3551
|
+
* from ASCII to EBCDIC. *
|
3552
|
+
* Move decoded and converted UserID *
|
3553
|
+
***********************************************************************
|
3554
|
+
ZD_0100 DS 0H
|
3555
|
+
MVC ZD_USER,EIGHT_40 Initialize to spaces
|
3556
|
+
MVC ZD_PASS,EIGHT_40 Initialize to spaces
|
3557
|
+
*
|
3558
|
+
LA R2,8 Set max field length
|
3559
|
+
LA R3,ZD_DEC Address decoded field (source)
|
3560
|
+
LA R6,ZD_USER Address UserID field (target)
|
3561
|
+
*
|
3562
|
+
***********************************************************************
|
3563
|
+
* Move decoded/converted field until ':' has been encountered. *
|
3564
|
+
***********************************************************************
|
3565
|
+
ZD_0110 DS 0H
|
3566
|
+
MVC 0(1,R6),0(R3) Move byte to UserId
|
3567
|
+
LA R3,1(,R3) Increment source field
|
3568
|
+
LA R6,1(,R6) Increment target field
|
3569
|
+
CLI 0(R3),C':' Colon?
|
3570
|
+
BC B'1000',ZD_0200 ... yes, process Password
|
3571
|
+
BCT R2,ZD_0110 ... no, continue
|
3572
|
+
***********************************************************************
|
3573
|
+
* At this point, the UserID has been moved. Now, move the Password *
|
3574
|
+
***********************************************************************
|
3575
|
+
ZD_0200 DS 0H
|
3576
|
+
LA R2,8 Set max field length
|
3577
|
+
LA R3,1(,R3) skip past ':'
|
3578
|
+
LA R6,ZD_PASS Address Password field (target)
|
3579
|
+
***********************************************************************
|
3580
|
+
* Move decoded/converted field until spaces or nulls are encountered. *
|
3581
|
+
***********************************************************************
|
3582
|
+
ZD_0210 DS 0H
|
3583
|
+
MVC 0(1,R6),0(R3) Move byte to UserId
|
3584
|
+
LA R3,1(,R3) Increment source field
|
3585
|
+
LA R6,1(,R6) Increment target field
|
3586
|
+
CLI 0(R3),X'00' Null?
|
3587
|
+
BC B'1000',ZD_0300 ... yes, decode complete
|
3588
|
+
CLI 0(R3),X'40' Space?
|
3589
|
+
BC B'1000',ZD_0300 ... yes, decode complete
|
3590
|
+
BCT R2,ZD_0210 ... no, continue
|
3591
|
+
***********************************************************************
|
3592
|
+
* At this point, the UserID and Password have been moved. *
|
3593
|
+
***********************************************************************
|
3594
|
+
ZD_0300 DS 0H
|
3595
|
+
MVC ZD_RC,=C'00' Set default return code
|
3596
|
+
*
|
3597
|
+
***********************************************************************
|
3598
|
+
* Return to calling routine *
|
3599
|
+
***********************************************************************
|
3600
|
+
ZD_0900 DS 0H
|
3601
|
+
LM R14,R12,12(R13) Load registers
|
3602
|
+
BCR B'1111',R14 Return to caller
|
3603
|
+
*
|
3604
|
+
***********************************************************************
|
3605
|
+
* Decode Base64Binary *
|
3606
|
+
***********************************************************************
|
3607
|
+
ZD_1000 DS 0H
|
3608
|
+
*
|
3609
|
+
***********************************************************************
|
3610
|
+
* This routine will convert the first of four encoded bytes. *
|
3611
|
+
***********************************************************************
|
3612
|
+
ZD_1010 DS 0H
|
3613
|
+
CLI 0(R3),X'7E' EOF (=)?
|
3614
|
+
BC B'1000',RC_0012 ... yes, invalid encode
|
3615
|
+
SR R5,R5 Clear odd register
|
3616
|
+
IC R5,0(R3) Load first encoded byte
|
3617
|
+
LA R3,1(,R3) Point to next encoded byte
|
3618
|
+
IC R5,B64XLT(R5) Translate from B64 alphabet
|
3619
|
+
SLL R5,26 Shift out the 2 Hi order bits
|
3620
|
+
SLDL R4,6 Merge 6 bits of R5 into R4
|
3621
|
+
*
|
3622
|
+
***********************************************************************
|
3623
|
+
* This routine will convert the second of four encoded bytes. *
|
3624
|
+
***********************************************************************
|
3625
|
+
ZD_1020 DS 0H
|
3626
|
+
CLI 0(R3),X'7E' EOF (=)?
|
3627
|
+
BC B'1000',RC_0012 ... yes, invalid encode
|
3628
|
+
SR R5,R5 Clear odd register
|
3629
|
+
IC R5,0(R3) Load first encoded byte
|
3630
|
+
LA R3,1(,R3) Point to next encoded byte
|
3631
|
+
IC R5,B64XLT(R5) Translate from B64 alphabet
|
3632
|
+
SLL R5,26 Shift out the 2 Hi order bits
|
3633
|
+
SLDL R4,6 Merge 6 bits of R5 into R4
|
3634
|
+
***********************************************************************
|
3635
|
+
* This routine will convert the third of four encoded bytes. *
|
3636
|
+
***********************************************************************
|
3637
|
+
ZD_1030 DS 0H
|
3638
|
+
CLI 0(R3),X'7E' EOF (=)?
|
3639
|
+
BC B'1000',ZD_1100 ... yes, process one octet
|
3640
|
+
SR R5,R5 Clear odd register
|
3641
|
+
IC R5,0(R3) Load first encoded byte
|
3642
|
+
LA R3,1(,R3) Point to next encoded byte
|
3643
|
+
IC R5,B64XLT(R5) Translate from B64 alphabet
|
3644
|
+
SLL R5,26 Shift out the 2 Hi order bits
|
3645
|
+
SLDL R4,6 Merge 6 bits of R5 into R4
|
3646
|
+
***********************************************************************
|
3647
|
+
* This routine will convert the fourth of four encoded bytes. *
|
3648
|
+
***********************************************************************
|
3649
|
+
ZD_1040 DS 0H
|
3650
|
+
CLI 0(R3),X'7E' EOF (=)?
|
3651
|
+
BC B'1000',ZD_1200 ... yes, process two octets
|
3652
|
+
SR R5,R5 Clear odd register
|
3653
|
+
IC R5,0(R3) Load first encoded byte
|
3654
|
+
LA R3,1(,R3) Point to next encoded byte
|
3655
|
+
IC R5,B64XLT(R5) Translate from B64 alphabet
|
3656
|
+
SLL R5,26 Shift out the 2 Hi order bits
|
3657
|
+
SLDL R4,6 Merge 6 bits of R5 into R4
|
3658
|
+
***********************************************************************
|
3659
|
+
* Process the three decoded bytes. *
|
3660
|
+
***********************************************************************
|
3661
|
+
ZD_1050 DS 0H
|
3662
|
+
STCM R4,7,0(R6) Save three decoded bytes
|
3663
|
+
TR 0(3,R6),A_TO_E Convert to EBCDIC
|
3664
|
+
LA R6,3(R6) Increment pointer
|
3665
|
+
BCR B'1111',R14 Return to caller
|
3666
|
+
***********************************************************************
|
3667
|
+
* Process single octet *
|
3668
|
+
***********************************************************************
|
3669
|
+
ZD_1100 DS 0H
|
3670
|
+
SLL R4,12 Shift a null digit into R4
|
3671
|
+
STCM R4,4,0(R6) Save single octet
|
3672
|
+
TR 0(3,R6),A_TO_E Convert to EBCDIC
|
3673
|
+
LA R2,1 Set counter to end process
|
3674
|
+
BCR B'1111',R14 Return to caller
|
3675
|
+
***********************************************************************
|
3676
|
+
* Process double octet *
|
3677
|
+
***********************************************************************
|
3678
|
+
ZD_1200 DS 0H
|
3679
|
+
SLL R4,6 Shift a null digit into R4
|
3680
|
+
STCM R4,6,0(R6) Save double octet
|
3681
|
+
TR 0(3,R6),A_TO_E Convert to EBCDIC
|
3682
|
+
LA R2,1 Set counter to end process
|
3683
|
+
BCR B'1111',R14 Return to caller
|
3684
|
+
***********************************************************************
|
3685
|
+
* Return code 12 - Invalid encode field provided *
|
3686
|
+
***********************************************************************
|
3687
|
+
RC_0012 DS 0H
|
3688
|
+
MVC ZD_RC,=C'12' Set return code 12
|
3689
|
+
BC B'1111',ZD_0900 Return to caller
|
3690
|
+
*
|
3691
|
+
*
|
3692
|
+
***********************************************************************
|
3693
|
+
* Literal Pool *
|
3694
|
+
***********************************************************************
|
3695
|
+
LTORG
|
3696
|
+
*
|
3697
|
+
DS 0F
|
3698
|
+
EIGHT_40 DC 08XL01'40' EBCDIC spaces
|
3699
|
+
ASCII_20 DC 18XL01'20' ASCII spaces
|
3700
|
+
*
|
3701
|
+
DS 0F
|
3702
|
+
*
|
3703
|
+
***********************************************************************
|
3704
|
+
* Translate table *
|
3705
|
+
* Base64Binary alphabet and corresponding six bit representation *
|
3706
|
+
***********************************************************************
|
3707
|
+
DS 0F
|
3708
|
+
B64XLT DC XL16'00000000000000000000000000000000' 00-0F
|
3709
|
+
DC XL16'00000000000000000000000000000000' 10-1F
|
3710
|
+
DC XL16'00000000000000000000000000000000' 20-2F
|
3711
|
+
DC XL16'00000000000000000000000000000000' 30-3F
|
3712
|
+
DC XL16'00000000000000000000000000003E00' 40-4F
|
3713
|
+
DC XL16'00000000000000000000000000000000' 50-5F
|
3714
|
+
DC XL16'003F0000000000000000000000000000' 60-6F
|
3715
|
+
DC XL16'00000000000000000000000000000000' 70-7F
|
3716
|
+
DC XL16'001A1B1C1D1E1F202122000000000000' 80-8F
|
3717
|
+
DC XL16'00232425262728292A2B000000000000' 90-9F
|
3718
|
+
DC XL16'00002C2D2E2F30313233000000000000' A0-AF
|
3719
|
+
DC XL16'00000000000000000000000000000000' B0-BF
|
3720
|
+
DC XL16'00000102030405060708000000000000' C0-CF
|
3721
|
+
DC XL16'00090A0B0C0D0E0F1011000000000000' D0-DF
|
3722
|
+
DC XL16'00001213141516171819000000000000' E0-EF
|
3723
|
+
DC XL16'3435363738393A3B3C3D000000000000' F0-FF
|
3724
|
+
*
|
3725
|
+
***********************************************************************
|
3726
|
+
* Translate table *
|
3727
|
+
* ASCII to EBCDIC *
|
3728
|
+
***********************************************************************
|
3729
|
+
DS 0F
|
3730
|
+
A_TO_E DC XL16'00000000000000000000000000000000' 00-0F
|
3731
|
+
DC XL16'00000000000000000000000000000000' 10-1F
|
3732
|
+
DC XL16'405A7F7B5B6C507D4D5D5C4E6B604B61' 20-2F
|
3733
|
+
DC XL16'F0F1F2F3F4F5F6F7F8F97A5E4C7E6E6F' 30-3F
|
3734
|
+
DC XL16'7CC1C2C3C4C5C6C7C8C9D1D2D3D4D5D6' 40-4F
|
3735
|
+
DC XL16'D7D8D9E2E3E4E5E6E7E8E9BAE0BB5F6D' 50-5F
|
3736
|
+
DC XL16'79818283848586878889919293949596' 60-6F
|
3737
|
+
DC XL16'979899A2A3A4A5A6A7A8A9C06AD0A107' 70-7F
|
3738
|
+
DC XL16'00000000000000000000000000000000' 80-8F
|
3739
|
+
DC XL16'00000000000000000000000000000000' 90-9F
|
3740
|
+
DC XL16'00000000000000000000000000000000' A0-AF
|
3741
|
+
DC XL16'00000000000000000000000000000000' B0-BF
|
3742
|
+
DC XL16'00000000000000000000000000000000' C0-CF
|
3743
|
+
DC XL16'00000000000000000000000000000000' D0-DF
|
3744
|
+
DC XL16'00000000000000000000000000000000' E0-EF
|
3745
|
+
DC XL16'00000000000000000000000000000000' F0-FF
|
3746
|
+
*
|
3747
|
+
DS 0F
|
3748
|
+
*
|
3749
|
+
PRINT ON
|
3750
|
+
***********************************************************************
|
3751
|
+
* End of Program - ZDECODE *
|
3752
|
+
**********************************************************************
|
3753
|
+
*
|
3754
|
+
***********************************************************************
|
3755
|
+
* Register assignment *
|
3756
|
+
***********************************************************************
|
3757
|
+
DS 0F
|
3758
|
+
R0 EQU 0
|
3759
|
+
R1 EQU 1
|
3760
|
+
R2 EQU 2
|
3761
|
+
R3 EQU 3
|
3762
|
+
R4 EQU 4
|
3763
|
+
R5 EQU 5
|
3764
|
+
R6 EQU 6
|
3765
|
+
R7 EQU 7
|
3766
|
+
R8 EQU 8
|
3767
|
+
R9 EQU 9
|
3768
|
+
R10 EQU 10
|
3769
|
+
R11 EQU 11
|
3770
|
+
R12 EQU 12
|
3771
|
+
R13 EQU 13
|
3772
|
+
R14 EQU 14
|
3773
|
+
R15 EQU 15
|
3774
|
+
*
|
3775
|
+
PRINT ON
|
3776
|
+
***********************************************************************
|
3777
|
+
* End of Program - ZFAM001 *
|
3778
|
+
**********************************************************************
|
3779
|
+
END ZFAM001
|