IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

I want to retire TRX and use only Rexx for this code


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Abhinav Sharma

New User


Joined: 29 Jul 2017
Posts: 3
Location: india

PostPosted: Sat Jul 29, 2017 2:53 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 29, 2017 4:25 am
Reply with quote

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
View user's profile Send private message
Abhinav Sharma

New User


Joined: 29 Jul 2017
Posts: 3
Location: india

PostPosted: Sat Jul 29, 2017 4:28 am
Reply with quote

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
View user's profile Send private message
Abhinav Sharma

New User


Joined: 29 Jul 2017
Posts: 3
Location: india

PostPosted: Sat Jul 29, 2017 4:31 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 419
Location: Denmark

PostPosted: Sat Jul 29, 2017 1:40 pm
Reply with quote

For concatenation update I use the CONCAT command found in FILE183.PDS at http://gsf-soft.com/Freeware/
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10729
Location: italy

PostPosted: Sat Jul 29, 2017 6:46 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 419
Location: Denmark

PostPosted: Sun Jul 30, 2017 3:17 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to replace a string dynamically i... CLIST & REXX 16
No new posts Determine Library REXX exec was execu... CLIST & REXX 7
No new posts How to convert RESP code 12 to text? CICS 9
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts Error 0C1 Reason Code 1 with branch i... PL/I & Assembler 3
Search our Forums:

Back to Top