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
 

 

Is a file can be allocate more than once ?

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

New User


Joined: 11 Jul 2006
Posts: 8

PostPosted: Tue Jul 11, 2006 8:21 pm    Post subject: Is a file can be allocate more than once ?
Reply with quote

I am confused about the allocate.

When I allocate a DSN to a file(DD name), I cannot allocate the other one to the same file(DD name) unless I free the file. That means a file can only be allocate once.

However, when I submit a JCL , the system will allocate the DSN to file(DD name) SYSIN , SYSPRINT and something like that. As there are lots of JCLs running at the same time, there should be several DSNs being allocated to the same DD name SYSIN.

So I wanna know, is a file can be allocate more than once?
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Jul 11, 2006 8:37 pm    Post subject: Re: Is a file can be allocate more than once ?
Reply with quote

If you are allocating them as NEW (to be created) rather than SHR or OLD (if they currently exist), it would make sense that you would have an allocation problem. As long as you are allocating them using SHR, there should not be a problem.

IDATASET = 'HLQ.DATA.SET.NAME'

"ALLOC FI(DDNAME1) DA("||IDATASET||") SHR REUSE"

"ALLOC FI(DDNAME2) DA("||IDATASET||") SHR REUSE"
Back to top
View user's profile Send private message
rainye

New User


Joined: 11 Jul 2006
Posts: 8

PostPosted: Wed Jul 12, 2006 7:31 pm    Post subject:
Reply with quote

I tried as follow :

Allocate file(AABBCC) dsn( 'HLQ.DATA1') NEW success
Allocate file(AABBCC) dsn( 'HLQ.DATA2') SHR success
Allocate file(AABBCC) dsn( 'HLQ.DATA3') SHR fail
Free dsn( 'HLQ.DATA1') fail
Free dsn( 'HLQ.DATA1')
success


Is that means only one dsn can be allocated to each file ?

If I neglect the NEW/SHR/MOD/OLD/SYSOUT option, what's the default value or
what make them different ?

In the JESYSMSG, it never metioned the way it allocates data sets.

IEF237I JES2 ALLOCATED TO SYSOUT
IGD103I SMS ALLOCATED TO DDNAME PASSFILE
IEF237I JES2 ALLOCATED TO REPORT1
IEF237I JES2 ALLOCATED TO SYSIN



I will try something later
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Jul 12, 2006 7:48 pm    Post subject: Re: Is a file can be allocate more than once ?
Reply with quote

You are correct. You cannot allocate several different dataset names to the same file (DD) name without freeing the file name after each ALLOC.

You should never neglect using the NEW/SHR/MOD/OLD options because that tells REXX whether the file currently exists or is being created for the 1st time.

On the command line, TSO HELP ALLOC will provide you will all the parameters associated with ALLOC, but their is no indication that NEW, SHR, MOD, or OLD is a "default" parameter which means you should always code something.
Back to top
View user's profile Send private message
rainye

New User


Joined: 11 Jul 2006
Posts: 8

PostPosted: Wed Jul 12, 2006 7:51 pm    Post subject:
Reply with quote

Thanks very much !
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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