View previous topic :: View next topic
|
Author |
Message |
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
Can anybody explain me, all the activities of IEFBR14? That means why it needed... And what it does? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi priya,
In a word it does "NOTHING".
It is a dummy pgm that basically returns immediately to the OS that called it after putting binary zeros in register 15. That's how it got it's name: it issues a BR14 BAL intruction that returns to the caller (the OS, in this case).
I's used primarily to use the OS's alloc/dealloc routines that are invoked at ANY step initiation and termination. You can easily create and/or dellete non-VSAM datasets by merely including DD cards for each file in the IEFBR14 step.
One thing to remember is that files created this way cannot be used as input in other steps/jobs because they have not been CLOSEd and therefore don't contain a valid EOF marker; they haven't been "initialized", for want of a better term.
Of course, you can safely use them for output.
HTH, Jack. |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
By summarizing mmwife's post....
IEFBR14
1. Clears Register 15
2. Branches the address of Register 14 (hence the name BR14) to system accumulator to revert the control back to system.
3. Pass return code as zero |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
(I'm asking this query from a very old post, I hope I'm not violatng forum rules)
MMWIFE used a term : EOF marker
above variable name is clear enough, what I can think of is -> it makes the system(OS) to understand that End Of File has reached,
Now I would like to ask the following:
1.What's the proper definition of EOF marker?
2. I think we can put EOF marker even for an empty file(I read in some manual) but in which situation sud we make this type of arrangement? &
3. what if a file does not have a EOF marker, (according to mmwife we cant use such files as input/s) then does that mean for such files the verb/s like READ will not work:
READ INPUT1
AT END (what will happen here.?, no EOF for this file)
Imperative sentence
END READ.
4. How can I find for a file whether this file is with proper EOF marker or not? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If the file does not have an EOF marker, the code will typically abend.
The EOF marker is internal (you don't write code to look for the "EOF value" in your program) - when program code issues a read, the "at end" condition is raised when the EOF is encountered.
It is far better to ensure that any file created has an EOF rather than try to figure this out later. One easy way to force an EOF is open the file for output, then close it without any write statements. You can also generate an EOF with IEBGENER or SORT.
In days past, simply cataloging a dataset caused the problem of no EOF which in turn caused abends (or running with incorrect data).
With SMS-managed data, an EOF is created automatically when the file is allocated.
My preference is still to make sure my files have a proper EOF - this is largely because i work on many systems and not all of them are 100% SMS-managed. It is a good thing to know that when you do something, you have not planted a time-bomb |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Anju,
I'd just add these 2 minor points to Dick's reply:
1) As I recall VSAM uses an addressing mechanism to keep track of the "EOF", not a "marker"; it amounts to the same thing though. Other access methods may use something similar (not sure).
2) If you use FILE STATUS when accessing the file, you won't abend when opening an empty "uninitialized" file for input, but you'll get a status code of 35 (I think). It's easy enough to try it and display the status. Maybe, unlike me, you'll remember what it was.
BTW, check your sort manual to determine how to set the right RC for your situation if you sort a file that may be empty. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Hi mmwife
Quote: |
One thing to remember is that files created this way cannot be used as input in other steps/jobs because they have not been CLOSEd and therefore don't contain a valid EOF marker; |
does this include sort steps also??
I created a file using IEFBR14 and used it as an input to my sort step which inserts a record in to the file. ( Input and output files are the same)
And this ran successfully..
Or is this EOF marker only being used when I read the file in a program??
Or is it because the file had an EOF marker since mine is an SMS-managed system.
Quote: |
With SMS-managed data, an EOF is created automatically when the file is allocated. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
This
Quote: |
Or is it because the file had an EOF marker since mine is an SMS-managed system.
|
is likely why it worked.
The EOF is associated with the file, not with the code that acesses it. If a file is opened/closed that will guarantee an EOF. As i mentioned before, my preference is to make sure any file i create will be readable by any process that needs to read it.
If the file was empty, and it was sorted, what was placed back into the file when the sort completed (or was the data created by the process before it became sortout)? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi Dick,
One more query:
Quote: |
My preference is still to make sure my files have a proper EOF - |
How should one be sure about above if the dataset is not allocated in SMS environment? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
From the fine manual ......... regarding SMS.
Quote: |
For sequential data sets, SMS writes a hardware EOF at the beginning of the data set at initial allocation. This prevents data integrity problems when applications try to read the data before data is written in the data set. |
For non SMS managed data, I would suggest creating it with IEBGENER, using SYSUT1 as DD DUMMY, which opens the SYSUT2 DD and does not write any data to it, but then creates the EOF at dataset close. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Thanks expat. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
For
Quote: |
How should one be sure about above if the dataset is not allocated in SMS environment? |
Please note this from earlier:
Quote: |
One easy way to force an EOF is open the file for output, then close it without any write statements. You can also generate an EOF with IEBGENER or SORT. |
Please let us know if there are any questions. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi Dick,
I read your replies very carefully , so the below quote was also unable to hide himself from my eyes
Quote: |
One easy way to force an EOF is open the file for output, then close it without any write statements. You can also generate an EOF with IEBGENER or SORT. |
Actually, I was thinking about 3.2 option of ISPF. If one allocate a file using 3.2 option of ISPF in a Non-SMS environment then how will one be sure about the EOF marker?
I am Mainframe user of current generation so I am not aware about whether ISPF was available in Non-SMS environment or not & I put the right question..!!(above one).
(Sometimes I think, if I could get the opprotunity to sit with people like you & you can tell me the story of Mainframes progress mixed with your personal experiences..then, I think, it would been be the best experience for me on this earth...ah dreams are always so pleasent.) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
To allocate a dataset in a non SMS environment you need access to a specific SMS STORCLAS.
Confused ? - You need an SMS STORCLAS to write a non SMS dataset
The selected STORCLAS tells SMS to ignore its ACS routines and to allocate a null STORCLAS to the dataset, thus making the dataset non SMS managed.
This is usually protected within the SMS ACS routines, only available to selected users, thus stopping the "user ordinaire" from allocating non SMS managed datasets. |
|
Back to top |
|
|
Vijay_ml
New User
Joined: 20 Mar 2007 Posts: 7 Location: India
|
|
|
|
How we can acess the uncatlg files?
To be more clear if any dataset have been created with (disp=,keep,keep)
so how we going to acess those files for some other processing. |
|
Back to top |
|
|
Vijay_ml
New User
Joined: 20 Mar 2007 Posts: 7 Location: India
|
|
|
|
How we can acess the uncatlg files?
To be more clear if any dataset have been created with (disp=,keep,keep)
so how we going to acess those files for some other processing. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Vijay_ml wrote: |
How we can acess the uncatlg files?
To be more clear if any dataset have been created with (disp=,keep,keep)
so how we going to acess those files for some other processing. |
First question Why have you appended your question onto a totally unrelated thread ?
Second question Have you searched this forum for any references to uncatalogued datasets, because the answer to your question has been posted quite recently.
Is your shop SMS managed ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Vijay, first - find the volser on which it was created (if you know someone who knows how to use the SMF data, you can find the VOLSER from SMF, if you cannot use SMF and you don't have the output from the job that created the file, you may find it using LISTVTOC - ) - then catalog the file or delete it. Uncataloged datasets are not your friend
Anuj, ISPF has been around for a very long time. If you use "3.2", and your dasd is non-SMS, you will have the "unusable file" problem. Your best bet is to proactively create the file with a valid EOF (posted earlier).
Good luck and we're here if there are questions |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Thanks Dick. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
expat wrote: |
To allocate a dataset in a non SMS environment you need access to a specific SMS STORCLAS.
Confused ? - You need an SMS STORCLAS to write a non SMS dataset
|
Not really correct. To create a NON-SMS managed dataset it needs to have attributes that cause the STORAGE CLASS ACS routine to not set a l storclass.
Some shops implement this by code in the ACS routine like this:
Code: |
IF &STORCLASS='NONSMS' THEN SET STORCLAS='' |
But there are many other ways that the ACS routines can also have a
Code: |
THEN SET STORCLAS='' |
For instance it may just be coded that if you specify a certain (NONSMS) volser in your jcl then the acs code will honour the allocation. eg
Code: |
IF &ANYVOL='SYS%%%' THEN SET STORCLAS='' |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
Not really correct. |
Of course it is correct, in every occurence the STORCLAS is set to '' |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
Well expat, I just showed how it can be done without using any STORCLAS, so it isn't correct.
Any dataset that has NO STORCLAS set becomes non-SMS managed.
So it can be done without you needing access to any specific SMS STORCLAS. The ACS routines just have to be coded correctly.
By using:
Code: |
IF &ANYVOL='SYS%%%' THEN SET STORCLAS='' |
you can bypass the need... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Yeah, but it's all site specific isn't it.
I never allow a non SMS allocation except to the chosen few, i.e. Storage, sysprogs, ( and dare I say it, even a couple of trusted JCLMs ).
I've always set it up that to be non SMS managed it must pass the filter for accepted users to STORCLAS=NONSMS, and of course filtered by DSN.
The way that you have shown - maybe there's more code to it - would allow ANYONE to allocate non SMS. Something I've found to be a real pain in past when people find out that they can - they almost certainly will - grab space anywhere. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
And then they often complain when their data is either relocated or removed.
For my $.02, following the storage management standards should be a condition of continued employment. . . |
|
Back to top |
|
|
|