DSN=DUMMY versus DSN=FILENAME

All sort of Mainframes Interview Questions.
Post Reply
Nikhil Aryan
New Member
Posts: 9
Joined: Mon Feb 29, 2016 8:47 pm
India

DSN=DUMMY versus DSN=FILENAME

Post 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.
User avatar
zum13
Active Member
Posts: 127
Joined: Thu May 04, 2023 12:58 am

Re: SN=DUMMY versus DSN=FILENAME

Post 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
 
User avatar
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 843
Joined: Wed Sep 11, 2013 3:57 pm

Re: SN=DUMMY versus DSN=FILENAME

Post 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 ....8-)
 
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 8-)
Nikhil Aryan
New Member
Posts: 9
Joined: Mon Feb 29, 2016 8:47 pm
India

Re: DSN=DUMMY versus DSN=FILENAME

Post 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?
User avatar
zum13
Active Member
Posts: 127
Joined: Thu May 04, 2023 12:58 am

Re: DSN=DUMMY versus DSN=FILENAME

Post 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.
Post Reply

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

Register

Sign in

Return to “Interview Questions.”