-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.BREXX
396 lines (377 loc) · 10.7 KB
/
INSTALL.BREXX
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
/* BREXX */
/* TRADER INSTALLER SCRIPT */
/* SHOULD BE SENT SEPARATE FROM THE XMIT */
/* 5/27/24 MODIFIED FOR 80 COLUMNS-A PITA */
/* 6/26/24 FIXED IMPROPER VARIABLE NAME IN GETMAXVOLFREE */
/* THANK YOU SPOOFY! */
CALL IMPORT FSSAPI
ADDRESS FSS
/* *********************************************** */
/* CHANGE THE USER NAME AND PASSWORD IN THE LINES */
/* BELOW! */
/* *********************************************** */
SYSUID='HERC01'
UIDPWD='CUL8TR'
/* IF THAT USERNAME/PW IS WRONG, JOBS WILL FAIL */
USERHLQ=SYSVAR('SYSUID')
SOURCE=USERHLQ||'.TRADER.XMIT'
DEST=USERHLQ||'.TRADER.INSTALL'
UNIT='SYSDA'
VOL=''
VSAM=''
CPROC="'SYS2.CMDPROC'"
/* GET A LIST OF VOLUMES, STORE TO VOLUMES. */
CALL LISTVOLS
IF VOLUMES.0=0 THEN
DO
SAY 'WHAT? THERE ARE NO VOLUMES ON THIS SYSTEM?!?'
EXIT
END
DO I=1 TO VOLUMES.0
IF INDEX(VOLUMES.I,'TRADER')>0 THEN
DO
SAY 'IT APPEARS YOU HAVE A TRADER VOLUME MOUNTED.'
SAY 'USING IT AS DEFAULT VOLUME NAMES.'
VOL='TRADER'
VSAM='TRADER'
LEAVE
END
END
IF STRIP(VOL)='' THEN
DO
CALL GETMAXVOLFREE
VOL=MAXVOL /* SUGGEST THIS VOLUME */
VOLFREE=MAXFREE
VSAM=MAXVOL
END
CALL XMITUNPACK
REFORM=1
DO UNTIL REFORM=0
CALL UNPACKPDS
END
ADDRESS TSO
"CLEARS"
SAY "ABOUT TO GENERATE AND SUBMIT JCL WITH THE FOLLOWING PARMS"
SAY ''
SAY 'SOURCE UPLOAD XMIT: '||SOURCE
SAY 'DESTINATION PDS: '||DEST
SAY 'UNIT SPEC: '||UNIT
SAY 'DSET VOLUME: '||VOL
SAY 'VSAM VOLUME: '||VSAM
SAY ''
SAY 'THE RESULTING GAME WILL BE INSTALLED WITH A FINAL'
SAY 'HLQ OF ''TRADER''. A CLIST WILL BE PLACED IN'
SAY 'SYS2.CMDPROC(TRADER) TO ESTABLISH THE TSO COMMAND'
SAY "'TRADER' (without quotes)"
SAY ''
SAY 'IS THIS CORRECT? ([Y]/N)'
PULL YN
IF STRIP(YN)='' THEN YN='Y'
YN = SUBSTR(YN,1,1)
IF TRANSLATE(YN)='Y' THEN
CALL COLLECTJCL
EXIT
XMITUNPACK:
ADDRESS FSS
CALL FSSINIT
CALL FSSTITLE 'MVS TRADER INSTALLATION',#PROT
CALL FSSTEXT ' UPLOADED XMIT:',4,3,,#PROT+#GREEN
CALL FSSTEXT 'OUTPUT DATASET:',6,3,,#PROT+#GREEN
CALL FSSTEXT 'UPLOADED XMIT-',10,3,,#PROT+#WHITE
CALL FSSTEXT 'Enter or accept the dataset you uploaded via IND$FILE',,
10,20,,#PROT+#GREEN
CALL FSSTEXT 'OUTPUT DATASET-',12,3,,#PROT+#WHITE
CALL FSSTEXT 'Enter the dataset name for the installation PDS, should be',,
12,20,,#PROT+#GREEN
CALL FSSTEXT 'located in your user HLQ',13,20,,#PROT+#GREEN
CALL FSSTEXT 'INVALID DATASET NAMES WILL RESULT IN JCL ERRORS!',21,1,,,
#PROT+#RED+#BLINK
CALL FSSTEXT '<PFK03> CANCEL <ENTER> NEXT',24,1,,#PROT+#WHITE
CALL FSSFIELD 'ZUPLOAD',4,20,40,#YELLOW+#USCORE,SOURCE
CALL FSSFIELD 'ZDEST',6,20,40,#YELLOW+#USCORE,DEST
CALL FSSCURSOR 'ZUPLOAD'
DO FOREVER
RKEY=FSSREFRESH()
IF RKEY=#PFK03 THEN CALL CANCELINSTALL
ZUPLOAD=FSSFGET('ZUPLOAD')
ZDEST=FSSFGET('ZDEST')
IF STRIP(ZUPLOAD)='' THEN
DO
CALL FSSZERRSM 'CANNOT BE BLANK'
CALL FSSCURSOR 'ZUPLOAD'
ITERATE
END
IF STRIP(ZDEST)='' THEN
DO
CALL FSSZERRSM 'CANNOT BE BLANK'
CALL FSSCURSOR 'ZDEST'
ITERATE
END
IF RKEY=#ENTER THEN
DO
SOURCE=STRIP(TRANSLATE(ZUPLOAD))
DEST=STRIP(TRANSLATE(ZDEST))
LEAVE
END
END
CALL FSSCLOSE
RETURN
UNPACKPDS:
/* UNPACK THE PDS */
ADDRESS FSS
CALL FSSCLOSE
CALL FSSINIT
CALL FSSTITLE 'MVS TRADER INSTALLATION',#PROT
CALL FSSTEXT,
'After the initial upload is unpacked, the installation phase will',3,1,,,
#PROT+#WHITE
CALL FSSTEXT,
'unpack MVS Trader into it''s final destination with the HLQ of TRADER',,
4,1,,#PROT+#WHITE
CALL FSSTEXT,
'You can specify a volume to store these datasets. Additionally, you',,
5,1,,#PROT+#WHITE
CALL FSSTEXT,
'MUST specify a volume with sufficient space for the universe VSAM',,
6,1,,#PROT+#WHITE
CALL FSSTEXT 'dataset.',7,1,,#PROT+#WHITE
CALL FSSTEXT ' UNIT=',9,3,,#PROT+#GREEN
CALL FSSTEXT ' VOLUME=',11,3,,#PROT+#GREEN
CALL FSSTEXT 'VSAM VOLUME=',13,3,,#PROT+#GREEN
CALL FSSFIELD 'ZUNIT',9,18,6,#YELLOW+#USCORE,UNIT
CALL FSSFIELD 'ZVOL',11,18,6,#YELLOW+#USCORE,VOL
CALL FSSFIELD 'ZVSAM',13,18,6,#YELLOW+#USCORE,VSAM
CALL FSSTEXT '<PFK03> CANCEL <ENTER> NEXT',24,1,,#PROT+#WHITE
CALL FSSTEXT '<PFK02> Show available volumes',23,1,,#PROT+#WHITE
CALL FSSCURSOR 'ZUNIT'
DO FOREVER
REFORM=0
RKEY=FSSREFRESH()
ZUNIT=FSSFGET('ZUNIT')
ZVOL=FSSFGET('ZVOL')
ZVSAM=FSSFGET('ZVSAM')
IF RKEY=#PFK03 THEN CALL CANCELINSTALL
IF RKEY=#PFK02 THEN
DO
CALL FSSCLOSE
CALL FSSVOLUMES
REFORM=1
LEAVE
END
IF STRIP(ZVSAM)='' THEN
DO
CALL FSSZERRSM 'CANNOT BE BLANK'
CALL FSSCURSOR 'ZVSAM'
ITERATE
END
IF RKEY=#ENTER THEN
DO
UNIT=STRIP(ZUNIT)
VOL=STRIP(TRANSLATE(ZVOL))
VSAM=STRIP(TRANSLATE(ZVSAM))
LEAVE
END
END
CALL FSSCLOSE
RETURN
FSSVOLUMES:
CALL SETG('NEWVOL',VOL)
CALL SETG('NEWVSAM',VSAM)
CALL SHOWVOLS
ADDRESS FSS
CALL FSSINIT
CALL FMTLIST 3,,HEADER,,
'Line commands: (S) set as source volume, (V) set as VSAM volume',,
'INSTALL'
VOL=GETG('NEWVOL')
VSAM=GETG('NEWVSAM')
RETURN
INSTALL_S:
NEWVOL=WORD(ARG(1),1)
CALL SETG('NEWVOL',NEWVOL)
RETURN 4
INSTALL_V:
NEWVSAM=WORD(ARG(1),1)
CALL SETG('NEWVSAM',NEWVSAM)
RETURN 4
SHOWVOLS:
OFFS=DCL('$DEFINE','VOLLIST')
OFFS=DCL('LVOL',1,15,'CHAR')
OFFS=DCL('LSPACE',,12,'CHAR')
OFFS=DCL('LDEV',,8,'CHAR')
OFFS=DCL('LTYPE',,8,'CHAR')
/* CREATE HEADER */
LVOL='VOLUME'
LSPACE='FREE'
LDEV='DEVICE'
LTYPE='TYPE'
HEADER=SETRECORD('VOLLIST')
DROP BUFFER.
BUFFER.0=0
DO I=1 TO VOLUMES.0
THISVOL=WORD(VOLUMES.I,1)
CALL LISTVOL WORD(VOLUMES.I,1)
FREESP=ROUND(100-(round(VOLTRKALC*100/Voltrks,1)),1)
THISFREE=FREESP||'%'
THISDEVICE=VOLDEVICE
THISTYPE=VOLTYPE
LVOL=THISVOL
LSPACE=THISFREE
LDEV=THISDEVICE
LTYPE=THISTYPE
BUFFER.I=SETRECORD('VOLLIST')
END
BUFFER.0=VOLUMES.0
RETURN
CANCELINSTALL:
/* INSTALL IS CANCELLED */
EXIT
RETURN
COLLECTJCL:
DROP UNPACKXMIT.
DROP UNPACKPDS.
DROP UNIVCR.
CALL UPACKXMIT
RC=SUBMIT('UNPACKXMIT.')
IF RC<>0 THEN
DO
SAY "JOB TO UNPACK THE XMIT DATASET HAS FAILED. RC="RC
EXIT
END
SAY "Waiting 5 seconds for the job to finish."
CALL WAIT(5000)
CALL UPACKPDS
RC=SUBMIT('UNPACKPDS.')
IF RC<>0 THEN
DO
SAY "JOB TO PROCESS THE INSTALLATION PDS HAS FAILED."
SAY "RC="RC
EXIT
END
SAY "Waiting 5 seconds for the job to finish."
CALL WAIT(5000)
CALL MODVSAM
CALL RUNSETCMD
SAY 'INSTALL SUCCESSFUL.'
SAY ' '
SAY 'Do you want to run the BIGBANG now? ([Y]/N)'
SAY 'This can take a considerable amount of time. 10 minutes or more.'
PULL YN
IF STRIP(YN)='' THEN YN='Y'
YN=SUBSTR(YN,1,1)
IF TRANSLATE(YN)='Y' THEN
DO
ADDRESS TSO
"RX 'TRADER.SOURCE(UNIINIT)'"
END
RETURN
UPACKXMIT:
UNPACKXMIT.1="//TRDRREC JOB 'XMIT RECEIVE',CLASS=A,MSGCLASS=A,"
UNPACKXMIT.2="// USER="||SYSUID||",PASSWORD="||UIDPWD
UNPACKXMIT.3="//RECV370 EXEC PGM=RECV370,REGION=8192K"
UNPACKXMIT.4="//RECVLOG DD SYSOUT=*"
UNPACKXMIT.5="//XMITIN DD DSN="||SOURCE||",DISP=SHR"
UNPACKXMIT.6="//SYSPRINT DD SYSOUT=*"
UNPACKXMIT.7="//SYSUT1 DD DSN=&&XMIT2,"
UNPACKXMIT.8="// UNIT="||UNIT||","
UNPACKXMIT.9="// SPACE=(TRK,(300,60)),"
UNPACKXMIT.10="// DISP=(NEW,DELETE,DELETE)"
UNPACKXMIT.11="//SYSUT2 DD DSN="||DEST||","
UNPACKXMIT.12="// UNIT=SYSDA,"
IF STRIP(VOL)<>'' THEN
UNPACKXMIT.13="// VOL=SER="||VOL||","
UNPACKXMIT.14="// SPACE=(TRK,(300,60,20)),"
UNPACKXMIT.15="// DISP=(NEW,CATLG,CATLG)"
UNPACKXMIT.16="//SYSIN DD DUMMY"
UNPACKXMIT.0=16
CALL STEMCLEN('UNPACKXMIT.')
RETURN
UPACKPDS:
UNPACKPDS.1="//TRDRUNP JOB 'XMIT UNPACK',CLASS=A,MSGCLASS=A,"
UNPACKPDS.2="// USER="||SYSUID||",PASSWORD="||UIDPWD
UNPACKPDS.3="//XMITLOAD PROC XMITLIB='"||DEST||"',"
UNPACKPDS.4="// HLQ='TRADER', "
IF STRIP(VOL)<>'' THEN
UNPACKPDS.5="// VOLM='"||VOL||"',"
ELSE
UNPACKPDS.5="// VOLM=,"
UNPACKPDS.6="// MEMBER="
UNPACKPDS.7="//STEP10 EXEC PGM=IKJEFT01"
UNPACKPDS.8="//SYSTSPRT DD SYSOUT=*"
UNPACKPDS.9="//SYSTSIN DD DUMMY"
UNPACKPDS.10="//STEP20 EXEC PGM=RECV370,REGION=4096K"
UNPACKPDS.11="//RECVLOG DD SYSOUT=*"
UNPACKPDS.12="//XMITIN DD DSN=&XMITLIB(&MEMBER),DISP=SHR"
UNPACKPDS.13="//SYSPRINT DD SYSOUT=*"
UNPACKPDS.14="//SYSUT1 DD DSN=&&SYSUT1,"
UNPACKPDS.15="// UNIT=SYSDA,"
UNPACKPDS.16="// SPACE=(TRK,(250,250)),"
UNPACKPDS.17="// DISP=(NEW,DELETE,DELETE)"
UNPACKPDS.18="//SYSUT2 DD DSN=&HLQ..&MEMBER,"
IF STRIP(VOL)<>'' THEN
UNPACKPDS.19="// UNIT=SYSDA,VOL=SER=&VOLM,"
ELSE
UNPACKPDS.19="// UNIT=SYSDA,"
UNPACKPDS.20="// SPACE=(TRK,(250,250,25),RLSE),"
UNPACKPDS.21="// DISP=(NEW,CATLG,DELETE)"
UNPACKPDS.22="//SYSIN DD DUMMY"
UNPACKPDS.23="// PEND"
UNPACKPDS.24="//UNPK10 EXEC XMITLOAD,MEMBER=SOURCE"
UNPACKPDS.25="//UNPK20 EXEC XMITLOAD,MEMBER=JCLLIB"
UNPACKPDS.26="//UNPK30 EXEC XMITLOAD,MEMBER=CMDPROC"
UNPACKPDS.27="//"
UNPACKPDS.0=27
RETURN
MODVSAM:
/* LOAD THE UNIVCR JCL INTO STEM */
/* CHANGE VOLUME(TRADER) INTO VOLUME(WHATEVER) */
/* WRITE THE STEM BACK TO UNIVCR */
/* TO ALLOW USER TO DEFINE WHAT VOLUME TO PLACE THE VSAM ON */
/* IF USER ENTERED VOLUME OF 'TRADER' THEN DONT BOTHER */
IF STRIP(VSAM)='TRADER' THEN
RETURN /* NOTHING TO CHANGE */
SAY "PRESS ENTER TO UPDATE THE JCL TO CREATE VSAM DATASET"
PULL WAIT
ADDRESS TSO
"ALLOCATE FILE(UNIVCR) DSN('TRADER.JCLLIB(UNIVCR)')"
IF RC<>0 THEN SAY "COULD NOT ALLOCATE UNIVCR"
"EXECIO * DISKR UNIVCR (STEM UNIVCR."
IF RC<>0 THEN SAY "COULD NOT READ UNIVCR"
/* THE VOLUMES SPEC IS ON STEM .21 */
NEWLINE=" VOLUMES("||VSAM||") -"
SAY 'CHANGING LINE 21 TO 'NEWLINE
UNIVCR.21=NEWLINE
"EXECIO * DISKW UNIVCR (STEM UNIVCR."
"FREE FILE(UNIVCR)"
RETURN
RUNSETCMD:
SAY "PRESS ENTER TO COPY THE TRADER PROC TO SYS2.CMDPROC"
PULL WAIT
ADDRESS TSO
"SUBMIT 'TRADER.JCLLIB(SETCMD)'"
IF RC<>0 THEN
DO
SAY "COULD NOT COPY THE TRADER PROC TO SYS2.CMDPROC"
SAY "YOU WILL HAVE TO RUN THE SCRIPT MANUALLY"
SAY "OR LOOK AT TRADER.JCLLIB(SETCMD) TO CORRECT"
SAY "IT, AND SUBMIT THE JOB MANUALLY."
EXIT
END
RETURN
GETMAXVOLFREE:
/* RETURNS THE VOLUME WITH THE MOST FREE SPACE */
WORKINGFREE=0
WORKINGVOL=''
DO I=1 TO VOLUMES.0
THISVOL=WORD(VOLUMES.I,1)
CALL LISTVOL THISVOL
FREE=(VOLTRKALC/VOLTRKS)/100
IF FREE>WORKINGFREE THEN
DO
WORKINGFREE=FREE
WORKINGVOL=THISVOL
END
END
MAXVOL=WORKINGVOL
MAXFREE=WORKINGFREE
RETURN