Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
I want to retire TRX and use only Rexx for this code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: I want to retire TRX and use only Rexx for this code
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: 8201
Location: East Dubuque, Illinois, USA

PostPosted: Sat Jul 29, 2017 4:25 am    Post subject: Reply to: I want to retire TRX and use only Rexx for this code
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    Post subject:
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    Post subject:
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: 186
Location: Switzerland

PostPosted: Sat Jul 29, 2017 1:40 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Sat Jul 29, 2017 6:46 pm    Post subject: Reply to: I want to retire TRX and use only Rexx for this code
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
http://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: 186
Location: Switzerland

PostPosted: Sun Jul 30, 2017 3:17 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Finding the plan when code compiled u... Ahemad DB2 1 Fri Dec 01, 2017 6:38 pm
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us