View previous topic :: View next topic
|
Author |
Message |
Abhinav Sharma
New User
Joined: 29 Jul 2017 Posts: 3 Location: india
|
|
|
|
Hi I want to retire TRX and use only Rexx for this code can anyone help me on this?
Code: |
SetFileDSN:
arg fileName, inputDSN
"trx list file("fileName") var" <===
i = 0
interpret "dsn = trxdsn#"i
do while(dsn ¬= "NOMOREDS")
if inputDSN = dsn then,
do
return 1
end
i = i + 1
interpret "dsn = trxdsn#"i
end
"TRX ADD DA('"inputDSN"') FI("fileName")" <===
return 0 |
Coded |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Presumably TRX is some vendor product? If you know what each TRX command is doing you may be able to code replacements. |
|
Back to top |
|
|
Abhinav Sharma
New User
Joined: 29 Jul 2017 Posts: 3 Location: india
|
|
|
|
TRX is no more used anywhere, i tried to search for it and i think the code is extracting a dataset from concatenation and then the file from it But i want to know what would be the function in rexx to do so. |
|
Back to top |
|
|
Abhinav Sharma
New User
Joined: 29 Jul 2017 Posts: 3 Location: india
|
|
|
|
This subroutine gets passed a dataset and file name. Then it
uses TRX to look for that dataset in the the DD concatenation
for that file name. If it finds the dataset in the concatenation
it returns a 1. If it doesn't find the dataset, it uses TRX to
place it into the concatenation and returns a zero. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I do not remember if BPXWDYN will return all the datasets in a concatenation
if it does not ...
here is a snippet that might help You
Code: |
/* $listdd */
$listdd:procedure
Trace "O"
parse arg ddnm
ddnm = translate(strip(ddnm))
list = ""
if ddnm = "" then ,
return list
tiotptr=24+ptr32(12+ptr32(ptr32(ptr32(16))))
tioelen=c2d(stg(tiotptr,1))
do until ( tioelen = 0 | tioeddn = ddnm )
tioeddn = strip(stg(tiotptr+4,8))
if tioeddn \= ddnm then ,
tiotptr=tiotptr+tioelen
tioelen=c2d(stg(tiotptr,1))
end
if tioeddn = ddnm then ,
Do Until ( tioelen=0 | stg(4+tiotptr,1) \= " " )
jfcb = swareq(stg(tiotptr+12,3))
list = list strip(stg(jfcb,44))
tiotptr=tiotptr+tioelen
tioelen=c2d(stg(tiotptr,1))
End
list = space(list)
return list
/* $ctlblks */
ptr32: Return c2d(Storage(d2x(Arg(1)),4))
ptr64: Return c2d(Storage(d2x(Arg(1)),8))
stg: Return Storage(d2x(Arg(1)),Arg(2))
/* swareq */
swareq:procedure
If right(c2x(Arg(1)),1) \= 'F' Then
return c2d(Arg(1))+16
sva = c2d(Arg(1))
tcb = ptr32(540)
jscb = ptr32(tcb+180)
qmpl = ptr32(jscb+244)
qmat = ptr32(qmpl+24)
do while (sva>65536)
qmat = ptr32(qmat+12)
sva = sva - 65536
end
return ptr32(qmat+sva+1)+16
|
invoked with ...
Code: |
dslist = $listdd("SOMEDD")
say dslist
|
it should return tha dataset names allocated to SOMEDD
the snippet is pretty old but it was tested and running ...
I still use it in my logon proc ( zOS pre 2.xxx )
see here for my TSO setup script
ibmmainframes.com/viewtopic.php?t=60112&highlight=listdd |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
BPXWDYN INFO will only return the first datasetname in a concatenation.
If you are running under ISPF then QBASELIB can be used as shown in this sample:
Code: |
"alloc dd(tcc) da('sys1.help' 'ISP.AISPHELP') shr reuse"
address ispexec "qbaselib tcc id(ds1)"
say 'tcc before:' ds1
"alloc dd(tcc) da("ds1 "'ISP.SISPHELP') shr reuse"
address ispexec "qbaselib tcc id(ds2)"
say 'tcc after:' ds2 |
|
|
Back to top |
|
|
|