forked from vlachoudis/brexx
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSTARGSUB.rexx
63 lines (63 loc) · 1.97 KB
/
STARGSUB.rexx
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
call SGFSSini
slino=5
do forever
ADDRESS FSS
'RESET'
CALL FSSTITLE 'Stargate Submit Job to Server ',#WHITE
call fsstext('Job is sent to Server 'getg('SG_IPADDR'),3,7,,#white)
nxt =sgfield("JCL", "JCL Dataset ===>",slino,3,54)
call fsstext('sending just "Do It Again"',18,25,,#white)
call fssmessage FSSHeight()-1
call fsscursor("JCL")
call fssdisplay()
'GET AID AID'
if aid=243 | aid=244 then return 4
call SGfetchVars
if JCL='' then iterate
stargate_mslv=4
selected=listpds(jcl)
if selected='' then iterate
end
return 0
ListPDS:
jcl=upper(arg(1))
call setg('SG_JCLSUB',jcl)
if LISTDSIX("'"jcl"'")>0 then return
/* it is a single Member out of a PDS */
if SYSDSORG='PO' & SYSDIRBLK='n/a' then NOP
else do
liblst=screate(500)
call dir("'"jcl"'")
do i=1 to direntry.0
if symbol('direntry.i.udate')='VAR' then ddate=direntry.i.udate
else ddate=''
if symbol('direntry.i.utime')='VAR' then dtime=direntry.i.utime
else dtime=''
call sset(LIBLST,,left(dirEntry.i.name,10)left(Ddate,10)left(Dtime,10))
end
call sqsort LIBLST,'DESC',10
buffer.0='ARRAY 'LIBLST
_screen.TopRow=2
_screen.TopRow.proc='jclhdr'
_screen.footer='Line cmd S to select JCL Member'
_screen.Message=1
call FMTLIST ,,'JCL Members of 'jcl,
'NAME CHANGED (sorted by change date)','JCL'
call sfree(LIBLST)
end
return 0
jclhdr:
call fsstext('Select JCL Member to be sent and submitted to '||,
getg('SG_IPADDR'),1,20,,#white)
return
jcl_s:
signal off syntax
socket=getg('sg_clientSocket')
jcl =getg('sg_JCLSUB')
rc=stargate('SEND',"$$$SOCKET",socket,'$$$DELIVER 'jcl'('word(arg(1),1)')')
subdsn=getg('SG_DSNTarget')
if subdsn='' then return 0
rc=stargate('SEND',"$$$SOCKET",socket,'$$$SUBMIT 'subdsn)
zerrsm='JCL Submitted'
zerrlm='JOB 'getg("submit_jobname")'('getg("submit_jobnum")') Submitted'
return 0