-
Notifications
You must be signed in to change notification settings - Fork 19
/
SRCBLDC.CLP
353 lines (276 loc) · 15.4 KB
/
SRCBLDC.CLP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
PGM
DCL VAR(&DESTFILE) TYPE(*CHAR) LEN(10) +
VALUE(SOURCE)
DCL VAR(&DESTLIB) TYPE(*CHAR) LEN(10) +
VALUE(QSHONI)
DCL VAR(&TGTRLS) TYPE(*CHAR) LEN(10) +
VALUE(*CURRENT)
DCL VAR(&VERSION) TYPE(*CHAR) LEN(30) +
VALUE(V1.0.33)
DCL VAR(&QSHPYTHON) TYPE(*CHAR) LEN(255)
DCL VAR(&CMD) TYPE(*CHAR) LEN(512)
DCL VAR(&LEN) TYPE(*DEC) LEN(15 5)
/** Add libraries to library list */
ADDLIBLE LIB(&DESTLIB)
MONMSG MSGID(CPF0000)
CRTCMD CMD(&DESTLIB/QSHPATH) PGM(&DESTLIB/QSHPATHC) +
SRCFILE(&DESTLIB/&DESTFILE) PRDLIB(&DESTLIB)
CRTCLPGM PGM(&DESTLIB/QSHPATHC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS)
CRTCMD CMD(&DESTLIB/QSHEXEC) PGM(&DESTLIB/QSHEXECC) +
SRCFILE(&DESTLIB/&DESTFILE) PRDLIB(&DESTLIB)
CRTCLPGM PGM(&DESTLIB/QSHEXECC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS)
CRTBNDRPG PGM(&DESTLIB/QSHSTDOUTR) +
SRCFILE(&DESTLIB/&DESTFILE) +
DFTACTGRP(*NO) REPLACE(*NO) TGTRLS(&TGTRLS)
CRTCMD CMD(&DESTLIB/QSHLOGSCAN) +
PGM(&DESTLIB/QSHLOGSCAC) +
SRCFILE(&DESTLIB/&DESTFILE) PRDLIB(&DESTLIB)
CRTCLPGM PGM(&DESTLIB/QSHLOGSCAC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS)
CRTBNDRPG PGM(&DESTLIB/QSHLOGSCAR) +
SRCFILE(&DESTLIB/&DESTFILE) +
DFTACTGRP(*NO) REPLACE(*NO) TGTRLS(&TGTRLS)
CRTCMD CMD(&DESTLIB/QSHBASH) PGM(&DESTLIB/QSHBASHC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.3 */
CRTCLPGM PGM(&DESTLIB/QSHBASHC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.3 */
/* 1.05 - ADD IFS CHECK AND QSHPYRUN */
CRTCMD CMD(&DESTLIB/QSHIFSCHK) +
PGM(&DESTLIB/QSHIFSCHKC) +
SRCFILE(&DESTLIB/&DESTFILE) PRDLIB(&DESTLIB)
CRTCLPGM PGM(&DESTLIB/QSHIFSCHKC) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHIFSCHKC) REPLACE(*NO) +
TGTRLS(&TGTRLS)
CRTBNDRPG PGM(&DESTLIB/QSHIFSCHKR) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHIFSCHKR) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS)
CRTCMD CMD(&DESTLIB/QSHPYRUN) +
PGM(&DESTLIB/QSHPYRUNC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.5 */
CRTCLPGM PGM(&DESTLIB/QSHPYRUNC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.5 */
CRTCMD CMD(&DESTLIB/QSHPHPRUN) +
PGM(&DESTLIB/QSHPHPRUNC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.24 */
CRTCLPGM PGM(&DESTLIB/QSHPHPRUNC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.24 */
CRTCMD CMD(&DESTLIB/QSHQRYTMP) +
PGM(&DESTLIB/QSHQRYTMPC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.8 */
CRTCLPGM PGM(&DESTLIB/QSHQRYTMPC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.8 */
CRTCMD CMD(&DESTLIB/QSHSETPROF) +
PGM(&DESTLIB/QSHSETPROC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.11 */
CRTCLPGM PGM(&DESTLIB/QSHSETPROC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.11 */
CRTCMD CMD(&DESTLIB/QSHCURL) PGM(&DESTLIB/QSHCURLC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.12 */
CRTCLPGM PGM(&DESTLIB/QSHCURLC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.12 */
CRTCMD CMD(&DESTLIB/QSHPORTCHK) +
PGM(&DESTLIB/QSHPORTCHC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.13 */
CRTCLPGM PGM(&DESTLIB/QSHPORTCHC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.13 */
/* QSHQRYTMP SQL('SELECT JOB_NAME FROM + */
/* QSYS2.NETSTAT_JOB_INFO') + */
/* OUTFILE(QTEMP/TCPTMPEND) V1.0.14 */
CHGVAR VAR(&CMD) VALUE('QSHQRYTMP SQL(''SELECT +
JOB_NAME FROM QSYS2.NETSTAT_JOB_INFO'') +
OUTFILE(QTEMP/TCPTMPEND)') /* V1.0.14 */
CHGVAR VAR(&LEN) VALUE(85)
CALL PGM(QCMDEXC) PARM(&CMD &LEN) /* V1.0.14 */
CRTCMD CMD(&DESTLIB/QSHPORTEND) +
PGM(&DESTLIB/QSHPORTENC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* V1.0.14 */
CRTCLPGM PGM(&DESTLIB/QSHPORTENC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* V1.0.14 */
CRTCMD CMD(&DESTLIB/QSHEXECSRC) +
PGM(&DESTLIB/QSHEXECSCC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.18 */
CRTCLPGM PGM(&DESTLIB/QSHEXECSCC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.18 */
CRTCMD CMD(&DESTLIB/DB2UTIL) PGM(&DESTLIB/DB2UTILC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.23 */
CRTCLPGM PGM(&DESTLIB/DB2UTILC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.23 */
CRTCMD CMD(&DESTLIB/QSHGETPARM) +
PGM(&DESTLIB/QSHGETPARR) +
SRCFILE(&DESTLIB/&DESTFILE) ALLOW(*IPGM +
*BPGM *IMOD *BMOD) PRDLIB(&DESTLIB) /* +
1.0.25 */
CRTBNDRPG PGM(&DESTLIB/QSHGETPARR) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHGETPARR) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS) /* 1.0.25 */
CRTCMD CMD(&DESTLIB/QSHPYCALL) +
PGM(&DESTLIB/QSHPYCALLC) +
SRCFILE(&DESTLIB/&DESTFILE) ALLOW(*IPGM +
*BPGM *IMOD *BMOD) PRDLIB(&DESTLIB) /* +
1.0.25 */
CRTCLPGM PGM(&DESTLIB/QSHPYCALLC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.25 */
CRTCLPGM PGM(&DESTLIB/QSHPYCALLT) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.25 */
CRTCMD CMD(&DESTLIB/QSHCALL) PGM(&DESTLIB/QSHCALLC) +
SRCFILE(&DESTLIB/&DESTFILE) ALLOW(*IPGM +
*BPGM *IMOD *BMOD) PRDLIB(&DESTLIB) /* +
1.0.25 */
CRTCLPGM PGM(&DESTLIB/QSHCALLC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.25 */
CRTCLPGM PGM(&DESTLIB/QSHCALLT) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.25 */
CRTCMD CMD(&DESTLIB/QSHCPYSRC) +
PGM(&DESTLIB/QSHCPYSRCC) +
SRCFILE(&DESTLIB/&DESTFILE) ALLOW(*IPGM +
*BPGM *IMOD *BMOD) PRDLIB(&DESTLIB) /* +
1.0.26 */
CRTCLPGM PGM(&DESTLIB/QSHCPYSRCC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.26 */
CRTCMD CMD(&DESTLIB/QSHBASHSRC) +
PGM(&DESTLIB/QSHBASHSCC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.27 */
CRTCLPGM PGM(&DESTLIB/QSHBASHSCC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.27 */
CRTRPGMOD MODULE(&DESTLIB/QSHONISRV) +
SRCFILE(&DESTLIB/&DESTFILE) +
DBGVIEW(*SOURCE) /* 1.0.28 */
CRTSRVPGM SRVPGM(&DESTLIB/QSHONISRV) +
MODULE(&DESTLIB/QSHONISRV) +
EXPORT(*SRCFILE) SRCFILE(&DESTLIB/SOURCE) +
SRCMBR(QSHONISRVD) BNDSRVPGM(*NONE) +
BNDDIR(*NONE) ACTGRP(*CALLER) /* 1.0.29 */
CRTBNDDIR BNDDIR(&DESTLIB/QSHONISRV) TEXT('Binding +
Directory for QSHONISRV Service Program') +
/* 1.0.28 */
ADDBNDDIRE BNDDIR(&DESTLIB/QSHONISRV) +
OBJ((&DESTLIB/QSHONISRV *SRVPGM *IMMED)) +
POSITION(*LAST) /* 1.0.28 */
CRTBNDRPG PGM(&DESTLIB/QSHONIPR01) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHONIPR01) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS) /* 1.0.28 */
CRTBNDRPG PGM(&DESTLIB/QSHONIPR02) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHONIPR02) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS) /* 1.0.28 */
CRTBNDRPG PGM(&DESTLIB/QSHONIPR03) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHONIPR03) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS) /* 1.0.29 */
CRTCMD CMD(&DESTLIB/QSHIFSSIZ) +
PGM(&DESTLIB/QSHIFSSIZC) +
SRCFILE(&DESTLIB/&DESTFILE) ALLOW(*IPGM +
*IMOD *BMOD *BPGM) PRDLIB(&DESTLIB) /* +
1.0.30 */
CRTBNDCL PGM(&DESTLIB/QSHIFSSIZC) +
SRCFILE(&DESTLIB/&DESTFILE) +
DFTACTGRP(*YES) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.30 */
CRTCMD CMD(&DESTLIB/QSHSAVLIB) +
PGM(&DESTLIB/QSHSAVLIBC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.32 */
CRTCLPGM PGM(&DESTLIB/QSHSAVLIBC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.32 */
CRTCMD CMD(&DESTLIB/QSHSAVIFS) +
PGM(&DESTLIB/QSHSAVIFSC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.32 */
CRTCLPGM PGM(&DESTLIB/QSHSAVIFSC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.32 */
CRTCMD CMD(&DESTLIB/QSHQRYSRC) +
PGM(&DESTLIB/QSHQRYSRCC) +
SRCFILE(&DESTLIB/&DESTFILE) +
PRDLIB(&DESTLIB) /* 1.0.32 */
CRTCLPGM PGM(&DESTLIB/QSHQRYSRCC) +
SRCFILE(&DESTLIB/&DESTFILE) REPLACE(*NO) +
TGTRLS(&TGTRLS) /* 1.0.32 */
CRTBNDRPG PGM(&DESTLIB/QSHQRYSRCR) +
SRCFILE(&DESTLIB/&DESTFILE) +
SRCMBR(QSHQRYSRCR) DFTACTGRP(*NO) +
REPLACE(*NO) TGTRLS(&TGTRLS) /* 1.0.32 */
/* Create message file for any custom CPF messages */
/* Initial use case is to log STDOUT msgs with own CPF ID */
CRTMSGF MSGF(&DESTLIB/QSHMSG) TEXT('Qshell CPF +
Messages')
/* General CPF message for joblog */
ADDMSGD MSGID(QSS9898) MSGF(&DESTLIB/QSHMSG) +
MSG('&1.') SECLVL('This message is used +
to log QSH console feedback messages.') +
FMT((*CHAR 512)) CCSID(*JOB)
/* Create and set data area for version */
CRTDTAARA DTAARA(&DESTLIB/VERSION) TYPE(*CHAR) LEN(30) +
VALUE(&VERSION) TEXT(&DESTLIB |> 'version')
MONMSG MSGID(CPF0000)
CHGDTAARA DTAARA(&DESTLIB/VERSION *ALL) VALUE(&VERSION)
/* Create and set data area for Python binary location - 1.05 */
CRTDTAARA DTAARA(QSHONI/PYPATH) TYPE(*CHAR) LEN(255) +
VALUE('/QOpenSys/pkgs/bin') TEXT('Path to +
Python Binaries')
/* Create and set data area for Python binary location - 1.0.25 */
CHGVAR VAR(&QSHPYTHON) VALUE('/qshpython')
CRTDTAARA DTAARA(QSHONI/QSHPYTHON) TYPE(*CHAR) +
LEN(255) VALUE(&QSHPYTHON) TEXT('Path to +
QSHONI Python Scripts')
/* Attempt to create python script directory - V1.0.25 */
MKDIR DIR(&QSHPYTHON) DTAAUT(*RWX) OBJAUT(*ALL)
MONMSG MSGID(CPF0000)
/* Create and set data area for PHP binary location - 1.0.24 */
CRTDTAARA DTAARA(QSHONI/PHPPATH) TYPE(*CHAR) LEN(255) +
VALUE(' ') TEXT('Path to PHP Binaries')
/* Create and set data area for open source path loc - 1.0.9 */
CRTDTAARA DTAARA(QSHONI/QSHPATHLOC) TYPE(*CHAR) +
LEN(10) VALUE('*BEGIN') TEXT('Path +
position for open source packages')
/* Create and set data area for dft IFS save file loc - 1.31 */
CRTDTAARA DTAARA(QSHONI/SAVFDIR) TYPE(*CHAR) LEN(255) +
VALUE('/tmp/savfqsh') TEXT('Path to save +
file IFS output')
/* Make /tmp/savf dir - 1.31 */
MKDIR DIR('/tmp/savfqsh') DTAAUT(*RWX) OBJAUT(*ALL)
MONMSG MSGID(CPF0000)
/* Change library desc to match the version */
CHGLIB LIB(QSHONI) TEXT('QShell on IBM i -' |> +
&VERSION)
/* Make /tmp/qsh dir */
MKDIR DIR('/tmp/qsh') DTAAUT(*RWX) OBJAUT(*ALL)
MONMSG MSGID(CPF0000)
ENDPGM