DSN=DUMMY versus DSN=FILENAME
-
- New Member
- Posts: 9
- Joined: Mon Feb 29, 2016 8:47 pm
DSN=DUMMY versus DSN=FILENAME
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
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
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
- enrico-sorichetti
- Global Moderator
- Posts: 843
- Joined: Wed Sep 11, 2013 3:57 pm
Re: SN=DUMMY versus DSN=FILENAME
NOPEThe 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
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
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
and continue with ENRICO.TEST.ZC
just tested ....

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

-
- New Member
- Posts: 9
- Joined: Mon Feb 29, 2016 8:47 pm
Re: DSN=DUMMY versus DSN=FILENAME
Thank you for correcting it, understood.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!
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.
Re: DSN=DUMMY versus DSN=FILENAME
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.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute