Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Free Dataset Allocation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
VijayKrish

New User


Joined: 30 Jun 2010
Posts: 10
Location: India

PostPosted: Mon Jul 19, 2010 2:39 pm    Post subject: Free Dataset Allocation
Reply with quote

I have a REXX program which allocates and writes some data to a PS. When the program is executed everytime, this dataset is deleted and a new one is created. When i run with my TSO id it runs fine. But when another user tries to run the same REXX program, it throws error message "Dataset already in Use". I am not sure if there is any thing wrong with the allocation parameters. Please help me out.

Below is the code:

Code:

OUTPS = "LLD.DRF.RECOMP.MODULES"   
MSG =  SYSDSN("'"OUTPS"'")         
X=MSG(OFF)                         
IF MSG = 'OK' THEN DO               
   ADDRESS TSO "DELETE '"OUTPS"'"   
END                                 
X=MSG(ON)                           
 L_RECL = 500 
 REC_FM = 'F B'
ADDRESS TSO "ALLOCATE DS("OUTPS") NEW SPACE(14,500)", 
            "LRECL("L_RECL") RECFM("REC_FM"),         
             DSORG(PS)"                               
ADDRESS TSO "ALLOC DA("OUTPS") F(XXOUT) OLD"           

                     "EXECIO" LOT.0 "DISKW XXOUT (STEM LOT."

 LOT.1= MEMNAME
 LOT.0=1       

 "EXECIO * DISKW XXOUT (FINIS"           
 "FREE F(XXOUT)"         
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Jul 19, 2010 3:50 pm    Post subject:
Reply with quote

Are you running concurrently using DISP=OLD
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 19, 2010 3:56 pm    Post subject:
Reply with quote

what is the purpose of this ds?

if everyone can use the REXX,
then as soon as one user has successfully executed the REXX,
before he can access the ds - for whatever purpose -
the next user executes the REXX, changes the ds and it is useless for the previous user.

without knowing 'the purpose of the ds', I would hazard a suggestion, that the HLQ be the USERID,
at least that way, user 1 could have use of the data in the ds before user 2 deletes and populates with his own data.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Jul 19, 2010 4:10 pm    Post subject:
Reply with quote

Unless the object is to get a list of modules to recompile
(psychic day special & a quick read of the REXX).
In which case only ONE user at any time will be able to allocate the dataset and in effect run the REXX.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 646
Location: Pennsylvania

PostPosted: Mon Jul 19, 2010 8:10 pm    Post subject:
Reply with quote

Hi Vijay,

First off, I agree with Dick that each user having their own version of the dataset would be preferable.

What I do is create a dataset that has a HLQ that is deleted by the system after a certain time to avoid cluter. This HLQ would be know by your storage people. The second node is then the user id.

Secondly, looking at you code, it appears to incomplete. You must have deceided what is relevant, and expected the people here to figure out the problem based what you determined to be important.

I would change some of that code as follows. See added comments.

Code:

OUTPS = "LLD.DRF.RECOMP.MODULES"   
MSG =  SYSDSN("'"OUTPS"'")         
X=MSG(OFF)

/* If file already exists then allocate as SHR */
/* Why delete and reallocate it */                         
IF MSG = 'OK' THEN DO
    ADDRESS TSO "ALLOC DA("OUTPS") F(XXOUT) SHR" 
END                                 
X=MSG(ON)
ELSE DO                           
  L_RECL = 500 
  REC_FM = 'F B'
 /*You did not give a file here I added F(XXXOUT)*/                               
  ADDRESS TSO "ALLOCATE DS("OUTPS") NEW SPACE(14,500)", 
  "LRECL("L_RECL") RECFM("REC_FM"),         
   DSORG(PS)  F(XXXOUT)"  ADDRESS TSO "ALLOC DA("OUTPS")
END

/* Why are you allocating it as old now */
F(XXOUT) OLD"           

                     "EXECIO" LOT.0 "DISKW XXOUT (STEM LOT."

 LOT.1= MEMNAME
 LOT.0=1        /* I did not think you can change the .0 and it work*/

 "EXECIO * DISKW XXOUT (FINIS"  /* why not 0 intead of  * */           
 "FREE F(XXOUT)"         
Back to top
View user's profile Send private message
VijayKrish

New User


Joined: 30 Jun 2010
Posts: 10
Location: India

PostPosted: Tue Jul 20, 2010 4:27 pm    Post subject: Reply to: Free Dataset Allocation
Reply with quote

I missed out giving the file in allocate statement which was causing the problem. Now it is running fine. Also i had changed the dataset names with userid as HLQ. Thanks for all your suggestion and quick response.
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 REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us