/
Git2zos.exec
executable file
·77 lines (77 loc) · 2.21 KB
/
Git2zos.exec
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
/* rexx */
/* trace r */
CALL SYSCALLS('ON')
parse UPPER arg dsnpfx semver
Address Syscall 'pipe p.' /* create a pipe */
'ls -l */>&'||p.2 /* send command output to pipe */
address syscall 'close' p.2 /* close pipe for output */
address mvs 'execio * diskr' p.1 '(stem s.' /* read pipe */
say s.0
do i = 1 to s.0 /* main loop */
if pos('/',s.i) > 0 then
do
tdir = strip(s.i,,':')
tdir = strip(tdir,,'/')
udir = translate(tdir)
pdsn = dsnpfx'.'udir'.'semver
call bpxwdyn "alloc fi(dd"i") da("pdsn") new catalog blksize(27920)",
"cyl space(2,1) lrecl(80) dsntype(library) recfm(f,b)",
"dsorg(po)"
call bpxwdyn "free fi(dd"i")"
flag = 0
k = i
do while flag = 0 /* flag loop */
k = k + 1
if k > s.0 then leave
if length(s.k) = 0 then
do
flag = 1
iterate
end
if substr(s.k,1,5) = 'total' then iterate
if pos('.',word(s.k,words(s.k))) > 0 then
do
fnm = strip(word(s.k,words(s.k)))
mnm = substr(fnm,1,(pos('.',fnm) - 1))
address syscall 'getcwd cwd'
fullPath = cwd||'/'tdir
ogcmd = "OGET '"fullPath"/"fnm"' '"pdsn"("mnm")'"
say ogcmd
address 'TSO' ogcmd
end
end /* end flag loop */
end /* end if for dir check */
/*tdir = strip(word(s.i,words(s.i)),,'/')
udir = translate(tdir)
pdsn = dsnpfx'.'udir'.'semver
call bpxwdyn "alloc fi(dd"i") da("pdsn") new catalog blksize(27920)",
"cyl space(2,1) lrecl(80) dsntype(library) recfm(f,b)",
"dsorg(po)"
address syscall 'getcwd cwd'
fullPath = cwd||'/'tdir
address syscall 'chdir 'fullPath
Address Syscall 'pipe p.'
'ls -al ./>&'||p.2
address syscall 'close' p.2
address mvs 'execio * diskr' p.1 '(stem f.'
do x=1 to f.0
if pos(f.x,'.'tdir) > 0 then
do
fnm = strip(word(f.x,words(f.x)))
mnm = substr(fnm,1,pos(fnm,'.'))
end
address syscall
'close' p.1
end */
/*
address syscall 'getcwd cwd'
fullPath = cwd||'/'tdir
ogcmd = "OGETX '"fullPath"' '"pdsn"' LC SUFFIX"
say ogcmd
address 'TSO' ogcmd
call bpxwdyn "free fi(dd"i")"
*/
end /* end main loop */
address syscall
'close' p.1
exit 0