MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To open a DSORG=DA file using REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
reachpgr
Beginner


Joined: 14 Oct 2003
Posts: 2
Topics: 1

PostPosted: Mon Aug 08, 2005 9:42 pm    Post subject: To open a DSORG=DA file using REXX Reply with quote

I need to open a Librarian file. It's DSORG=DA. To develop a tool I need to open the COBOL programs found in the Library. How do I acheive it using REXX?
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Tue Aug 09, 2005 12:55 am    Post subject: Reply with quote

Take a look at the librarian utilities or macros to access the data.
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Aug 09, 2005 5:24 am    Post subject: Reply with quote

Reachpgr,

You need to use SUBSYS=LAM to allocate Libraries datasets. But TSO does not support LAM. If you have BPXWDYN in your shop or any such utilities (Other than TSO ALLOC) which could be used to allocate datasets, you can use them as shown below.

Link to BPXWDYN ==> http://www.mvsforums.com/helpboards/viewtopic.php?t=2520&highlight=bpxwdyn

But still (after allocation), you can't open these datasets using ISPF EDIT/VIEW commands. Instead you need to use SORT or IEB utilities to copy this to a temporary dataset and then open it instead. (The best way would be to use librarian utilities. but I'm still researching on that).

In the code below DSNAME & MEMNAME refer to the DA-PDS and its member.
Code:

  MEMNAME = STRIP(MEMNAME)                                           
  DSNAME  = STRIP(PRODDSN)||'('MEMNAME')'                           
  DSNAME  = STRIP(DSNAME)                                           
                                                                     
  OUT.1 = "    SORT FIELDS=COPY"                                     
  OUT.0 = 1                                                         
                                                                     
  CALL MSG('OFF')                                                   
 "FREE FI(SYSOUT SORTIN SORTOUT SYSIN)"                             
 "ALLOC FI(SYSOUT)  DUMMY SHR REUSE"                                 
                                                                     
  SCARD = "    ALLOC FI(SORTIN) DA('"DSNAME"') SUBSYS(LAM) SHR"     
  CALL BPXWDYN(SCARD)                                               
                                                                     
  /* * * * * * * * * * * * * * * * * * */                           
  /*   ALLOCATE A FILE FOR SYSIN AND   */                           
  /*    WRITE THE SORTCARD INTO IT.    */                           
  /* * * * * * * * * * * * * * * * * * */                           
  SCARD = "    ALLOC FI(SYSIN) DA(&&T1) REUSE"                       
  CALL BPXWDYN(SCARD)                                               
 "EXECIO "OUT.0" DISKW SYSIN (STEM OUT. FINIS"           
                                                         
  TEMP_PS = "'"||USERID()||'.TEMP.'||MEMNAME||,       
                     '.D'||SUBSTR(DATE('S'),3,6)||,     
                     '.T'||TIME('S')||"'"               
  RC = CREATE_TEMP_DATASET(TEMP_PS)                     
                                                         
  /* * * * * * * * * * * * * * * * * * */               
  /*    CALL SORT PROGRAM USING THE    */               
  /*    DYNAMICALLY BUILD SORT CARD    */               
  /* * * * * * * * * * * * * * * * * * */               
  ADDRESS LINKMVS SORT                                   
 "FREE FI(SYSOUT SORTIN SORTOUT SYSIN)"                 
                                                         
 "ISPEXEC VIEW DATASET("TEMP_PS")"                       
  CALL MSG('ON')                         
                                                                       
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
                                                                       
/* * * * * * * * * * * * * * * * */                                   
/*      CREATE TEMP DATASET      */                                   
/* * * * * * * * * * * * * * * * */                                   
                                                                       
CREATE_TEMP_DATASET: PROCEDURE                                         
ARG PSNAME                                                             
                                                                       
  CALL MSG('OFF')                                                     
 "ALLOC FI(SORTOUT) DA("PSNAME") NEW UNIT(SYSDA)",                     
 "SP(10, 90) TRA DSORG(PS) DIR(0) BLKSIZE(8000)",                     
 "LRECL(80) RECFM(F B) REUSE"                                         
  CALL MSG('ON')                                                       
RETURN RC                                                                             


Here, I called SORT utility from within the REXX program and copy the DA-MEMBER to a temporary PS and open it using ISPEXEC EDIT/VIEW command.

More info. on allocating DA datasets ==> http://www.mvsforums.com/helpboards/viewtopic.php?t=2319&highlight=librarian

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
reachpgr
Beginner


Joined: 14 Oct 2003
Posts: 2
Topics: 1

PostPosted: Wed Aug 10, 2005 9:21 pm    Post subject: Thnaks a ton Reply with quote

Hi Phantom,
Thanks a lot, the link you provided the info that we can open the Librarian file like below

//INFILE DD DSN=YOUR.PDS(BLAHBLAH),DISP=SHR,SUBSYS=LAM

and open it in COBOL program as usual. I am able to do it and I completed my tool. Thanks again !!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group