View previous topic :: View next topic |
Author |
Message |
reachpgr Beginner
Joined: 14 Oct 2003 Posts: 2 Topics: 1
|
Posted: Mon Aug 08, 2005 9:42 pm Post subject: To open a DSORG=DA file using REXX |
|
|
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 |
|
|
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Tue Aug 09, 2005 12:55 am Post subject: |
|
|
Take a look at the librarian utilities or macros to access the data. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Tue Aug 09, 2005 5:24 am Post subject: |
|
|
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 |
|
|
reachpgr Beginner
Joined: 14 Oct 2003 Posts: 2 Topics: 1
|
Posted: Wed Aug 10, 2005 9:21 pm Post subject: Thnaks a ton |
|
|
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 |
|
|
|
|