Page 1 of 1
DSN=DUMMY versus DSN=FILENAME
Posted: Wed Jan 29, 2025 10:54 am
by Nikhil Aryan
Could you please explain the differences and advantages of using DSN=DUMMY versus DSN=FILENAME, where FILENAME is an empty sequential dataset and an empty VSAM dataset?Additionally, is there any difference between using DD DUMMY and DD DSN=NULLFILE?This was an interview question, and despite referring to some JCL books, I couldn’t find a clear answer.
Re: SN=DUMMY versus DSN=FILENAME
Posted: Wed Jan 29, 2025 11:31 pm
by zum13
Hello.
First of all, the dummy syntax is "DD DUMMY" not "DD DSN=DUMMY". Coding "DD DSN=NULLFILE" is essentially the same thing as coding "DD DUMMY", it just takes slightly longer to type!
When "DD DUMMY" is used on an input DDName, it simulates an empty file. So, if you needed to, say, create an empty member in a PDS, or clear the data from an existing dataset, you could just run IEBGENER with SYSUT1 set to "DD DUMMY" and SYSUT2 set to the output and it would perform those tasks.
The difference between "DD DUMMY" and "DD DSN=empty.dataset" on an input is simply that you need to have an empty dataset allocated which is consuming disk space. Attempting to read either will result in the same outcome; end of file.
As an output, "DD DUMMY" becomes a null file. It is the equivalent of the "NUL" file under Windoze or "/dev/null" in Unix/Posix systems. You can write as much as you like to that particular DDName and the records just disappear. You'd use this in the scenario where a program is writing data, but you don't need all or part of the output from it.
"DD DUMMY" can also be used with VSAM files. Personally, I've not seen this done and have never had to use it, so I can't really comment any further on that scenario.
For answers to JCL questions, the best first place to look are IBM's manuals:
- MVS JCL Reference:
https://www.ibm.com/docs/en/zos/3.1.0?t ... -reference
- MVS JCL User's Guide:
https://www.ibm.com/docs/en/zos/3.1.0?t ... sers-guide
Re: SN=DUMMY versus DSN=FILENAME
Posted: Thu Jan 30, 2025 1:34 am
by enrico-sorichetti
The difference between "DD DUMMY" and "DD DSN=empty.dataset" on an input is simply that you need to have an empty dataset allocated which is consuming disk space. Attempting to read either will result in the same outcome; end of file
NOPE
when processing a single dataset that is , by pure chance, true
but when processing a dataset concatenation the behavior is different
Code: Select all
000008 //SYSUT1 DD DISP=SHR,DSN=ENRICO.TEST.ZA
000009 // DD DISP=SHR,DSN=NULLFILE
000010 // DD DISP=SHR,DSN=ENRICO.TEST.ZC
processing will stop at dsn=nullfile and the third dataset will be ignored
but having
Code: Select all
000008 //SYSUT1 DD DISP=SHR,DSN=ENRICO.TEST.ZA
000009 // DD DISP=SHR,DSN=ENRICO.TEST.ZB.EMPTY
000010 // DD DISP=SHR,DSN=ENRICO.TEST.ZC
the process will process ENRICO.TEST.ZB.EMPTY returning a normal eof
and continue with ENRICO.TEST.ZC
just tested ....
Re: DSN=DUMMY versus DSN=FILENAME
Posted: Tue Feb 04, 2025 8:56 am
by Nikhil Aryan
First of all, the dummy syntax is "DD DUMMY" not "DD DSN=DUMMY". Coding "DD DSN=NULLFILE" is essentially the same thing as coding "DD DUMMY", it just takes slightly longer to type!
Thank you for correcting it, understood.
As an output, "DD DUMMY" becomes a null file. It is the equivalent of the "NUL" file under Windoze or "/dev/null" in Unix/Posix systems. You can write as much as you like to that particular DDName and the records just disappear. You'd use this in the scenario where a program is writing data, but you don't need all or part of the output from it.
But if I use an actual empty file, the data will still be written, now as coder I should decide to keep it or not?
Re: DSN=DUMMY versus DSN=FILENAME
Posted: Mon Feb 17, 2025 12:41 am
by zum13
Yes, if you use an empty file and the program you are running writes data to it, the data will get written to the once empty dataset.