View previous topic :: View next topic
|
Author |
Message |
harsha vardhan
New User
Joined: 25 May 2008 Posts: 1 Location: hyderabad
|
|
|
|
Explain the use of dummy and temporary datasets with coding |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
a dummy ds is a dd parm that indicates that there is to be no dataset allocated.
you can use the dd dummy parm on an output ds that you no longer want to generate,
or you can use it to simulate an empty input file file.
you can also use it as a place holder dd that can be overriden
temporary ds are only allocated for the life of the job. at the end of job, the temporary ds are deleted.
no coding involved as these are dd statement parms. (though I guess one could call creating JCL as coding) - (but I will bet money that that is not what you meant by coding). |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi,
DUMMY Dataset:
The use a a DD statement with a DUMMY parameter will allow a program to run if a data set does not exist. The following example show a DD DUMMY statement.
Code: |
//QSAM0080 DD DUMMY |
The following is the COBOL SELECT statement.
Code: |
SELECT QSAM0080-FILE
ASSIGN to QSAM0080
ORGANIZATION is SEQUENTIAL
ACCESS MODE is SEQUENTIAL
FILE STATUS is QSAM0080-STATUS. |
The following shows the COBOL statements for the open, read and close of the QSAM0080 data set (i.e. sequential file).
Code: |
open input QSAM0080-FILE
...
read QSAM0080-FILE.
...
close QSAM0080-FILE
|
In the preceding example the OPEN will be successful, the first READ will return an End-of-File return code and the close will be successful.
Temporary Datset:
A dataset that exists on either DASD or TAPE only during the execution of the jobstream that creates it and it will be deleted after execution of the job.
KSK |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
These thing has been discussed earlier as well, please search the forum.
- DUMMY
One such link for DUMMY is
www.ibmmainframes.com/viewtopic.php?t=23023&highlight=dummy
- TEMP
In JCL you just have to write DSN=&&TEMP instead of DSN=XXXX.X.XXXX.XXX. to create a temporary dataset. To use this temporary dataset just use &TEMP wherever you want the use the temporary data. I hope this answers a part of your question.
As far as usage part is concerned. I believe the temporary datasets are generally used to save space allocation and deallocation time. I mean just take a case where a Procedure generates an ouput now you jus need to send the output via some Mailing Procedure you have, right. So just mail that temp. dataset using &TEMP. At the end of the execution the temporary dataset get removed but if i would have used a permanent dataset then i had to use IEFBR14 to delete the file at the end of JCL so as to deallocate the dataset.
One thing about temp to remember, temp files are ussually used as DSN=&&TEMP, some more are here in this links..
www.ibmmainframes.com/about26679.html |
|
Back to top |
|
|
|