{"id":1532,"date":"2023-07-29T04:00:00","date_gmt":"2023-07-28T22:30:00","guid":{"rendered":"https:\/\/zmainframes.com\/zlog\/?p=1532"},"modified":"2023-11-23T11:38:52","modified_gmt":"2023-11-23T06:08:52","slug":"difference-between-dummy-and-nullfile-in-mainframes","status":"publish","type":"post","link":"https:\/\/zmainframes.com\/zlog\/difference-between-dummy-and-nullfile-in-mainframes\/","title":{"rendered":"Difference between DUMMY and NULLFILE in mainframes"},"content":{"rendered":"\r\n<p class=\"has-text-align-center\"><span style=\"text-decoration: underline;\"><strong>Understanding the Difference Between DUMMY and NULLFILE in Mainframes<\/strong><\/span><\/p>\r\n\r\n\r\n\r\n<p><strong>Introduction:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>Mainframes have been an integral part of the computing industry for decades, supporting critical business operations and handling vast amounts of data. As mainframe programmers, it&#8217;s essential to understand the intricacies of various file handling techniques. In this blog, we will explore the key differences between DUMMY and NULLFILE in mainframes, catering to both mainframe programmers and non-programmers. We will also provide coding examples to illustrate their practical applications.<img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\" wp-image-1969 alignright\" src=\"https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=602%2C339&#038;ssl=1\" alt=\"\" width=\"602\" height=\"339\" title=\"\" srcset=\"https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=1%2C1&amp;ssl=1 1w, https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?resize=150%2C84&amp;ssl=1 150w, https:\/\/i0.wp.com\/zmainframes.com\/zlog\/wp-content\/uploads\/2023\/07\/Difference-Between-Dummy-and-Nullfile-in-Mainframes.png?w=1280&amp;ssl=1 1280w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/p>\r\n\r\n\r\n\r\n<p><strong>Part 1: Understanding DUMMY Files<\/strong><\/p>\r\n\r\n\r\n\r\n<p>DUMMY files are a unique type of data set in mainframes. They serve specific purposes and are crucial for various operations. Essentially, a DUMMY file doesn&#8217;t contain any data, but it is essential for certain job steps that require a valid data set reference.<\/p>\r\n\r\n\r\n\r\n<p>1.1 Definition and Characteristics of DUMMY Files:<\/p>\r\n\r\n\r\n\r\n<p>In simple terms, a DUMMY file is used when a program expects a data set but doesn&#8217;t need any actual data to be read or written. It acts as a placeholder to satisfy program syntax requirements.<\/p>\r\n\r\n\r\n\r\n<p>Here are the main characteristics of a DUMMY file:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>No actual data is stored in a DUMMY file.<\/li>\r\n\r\n\r\n\r\n<li>The file is typically defined with the DUMMY disposition in JCL (Job Control Language).<\/li>\r\n\r\n\r\n\r\n<li>DUMMY files are used for various purposes, such as providing empty input data sets or bypassing certain steps.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p><strong>1.2 Example: Using DUMMY Files in JCL<\/strong><\/p>\r\n\r\n\r\n\r\n<p>Let&#8217;s consider an example where we have a COBOL program that reads data from an input file and writes the output to another file. However, in some cases, we might not have any input data available. In such scenarios, we can use a DUMMY file as a placeholder for the input data set.<\/p>\r\n\r\n\r\n\r\n<p>Here&#8217;s how the JCL would look:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" style=\"font-size: .875rem; font-family: Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; --cbp-line-number-color: #adbac7; --cbp-line-number-width: 7.7000017166137695px; line-height: 1.25rem;\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\"><span style=\"display: flex; align-items: center; padding: 10px 0px 10px 16px; margin-bottom: -2px; width: 100%; text-align: left; background-color: #2d333d; color: #9eadbd;\">COBOL<\/span>\r\n<pre class=\"shiki github-dark-dimmed\" style=\"background-color: #22272e;\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">JOBNAME   JOB (ACCOUNT),<\/span><span style=\"color: #96d0ff;\">'DESCRIPTION'<\/span><span style=\"color: #adbac7;\">,<\/span><span style=\"color: #f47067;\">CLASS=class<\/span><span style=\"color: #adbac7;\">,MSGCLASS<\/span><span style=\"color: #f47067;\">=class<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">STEP1     EXEC PGM<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">COBOLPGM<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/INPUT<\/span><span style=\"color: #adbac7;\">     DD DUMMY            (Dummy <\/span><span style=\"color: #f47067;\">input<\/span> <span style=\"color: #f47067;\">data<\/span> <span style=\"color: #f47067;\">set<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/OUTPUT<\/span><span style=\"color: #adbac7;\">    DD <\/span><span style=\"color: #6cb6ff;\">SYSOUT<\/span><span style=\"color: #f47067;\">=*<\/span><span style=\"color: #adbac7;\">         (<\/span><span style=\"color: #f47067;\">Output<\/span><span style=\"color: #adbac7;\"> will be printed <\/span><span style=\"color: #f47067;\">in<\/span><span style=\"color: #adbac7;\"> the <\/span><span style=\"color: #6cb6ff;\">sysout<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/*<\/span><\/span><\/code><\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">\u00a0<\/pre>\r\n\r\n\r\n\r\n<p>In this example, the program COBOLPGM expects an input data set. We use the DUMMY file for the INPUT DD statement to fulfill this requirement when actual data is not available.<\/p>\r\n\r\n\r\n\r\n<p><strong>Part 2: Understanding NULLFILEs<\/strong><\/p>\r\n\r\n\r\n\r\n<p>NULLFILEs, on the other hand, are quite different from DUMMY files in terms of their purpose and characteristics. While DUMMY files are used as placeholders, NULLFILEs serve a more specific and advanced function.<\/p>\r\n\r\n\r\n\r\n<p><strong>2.1 Definition and Characteristics of NULLFILEs:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>A NULLFILE is a type of data set that can be read from or written to, but it doesn&#8217;t consume any system resources. Unlike DUMMY files, NULLFILEs are not just placeholders but provide a way to perform operations without storing any data.<\/p>\r\n\r\n\r\n\r\n<p>Here are the main characteristics of a NULLFILE:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>NULLFILEs consume no disk space or memory.<\/li>\r\n\r\n\r\n\r\n<li>They are created using specific attributes that enable them to be used efficiently for various purposes.<\/li>\r\n\r\n\r\n\r\n<li>When reading from a NULLFILE, it behaves as if it contains an infinite number of records with a specific attribute value (usually NULL).<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p><strong>2.2 Example: Using NULLFILEs in JCL<\/strong><\/p>\r\n\r\n\r\n\r\n<p>Suppose we have a COBOL program that generates some output data, but we don&#8217;t want to store that data in a physical file. Instead, we need to perform further processing on the generated data without using additional resources.<\/p>\r\n\r\n\r\n\r\n<p>Let&#8217;s see how we can use a NULLFILE in this scenario:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" style=\"font-size: .875rem; font-family: Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; --cbp-line-number-color: #adbac7; --cbp-line-number-width: 15.399998664855957px; line-height: 1.25rem;\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\"><span style=\"display: flex; align-items: center; padding: 10px 0px 10px 16px; margin-bottom: -2px; width: 100%; text-align: left; background-color: #2d333d; color: #9eadbd;\">COBOL<\/span>\r\n<pre class=\"shiki github-dark-dimmed\" style=\"background-color: #22272e;\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">JOBNAME   JOB (ACCOUNT),<\/span><span style=\"color: #96d0ff;\">'DESCRIPTION'<\/span><span style=\"color: #adbac7;\">,<\/span><span style=\"color: #f47067;\">CLASS=class<\/span><span style=\"color: #adbac7;\">,MSGCLASS<\/span><span style=\"color: #f47067;\">=class<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">STEP1     EXEC PGM<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">COBOLPGM<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/INPUT<\/span><span style=\"color: #adbac7;\">     DD DUMMY            (Dummy <\/span><span style=\"color: #f47067;\">input<\/span> <span style=\"color: #f47067;\">data<\/span> <span style=\"color: #f47067;\">set<\/span> <span style=\"color: #f47067;\">or<\/span> <span style=\"color: #f47067;\">any<\/span> <span style=\"color: #f47067;\">other<\/span> <span style=\"color: #ff938a; font-style: italic;\">actual<\/span> <span style=\"color: #f47067;\">data<\/span> <span style=\"color: #f47067;\">set<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/OUTPUT<\/span><span style=\"color: #adbac7;\">    DD DSN<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">&amp;&amp;TEMPDS,DISP<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(NEW,PASS),SPACE<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(TRK,<\/span><span style=\"color: #6cb6ff;\">1<\/span><span style=\"color: #adbac7;\">),<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">           DCB<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(RECFM<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">FB,LRECL<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #6cb6ff;\">80<\/span><span style=\"color: #adbac7;\">,BLKSIZE<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #6cb6ff;\">80<\/span><span style=\"color: #adbac7;\">) (Temporary <\/span><span style=\"color: #f47067;\">data<\/span> <span style=\"color: #f47067;\">set<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">NULLFILE  DD DSN<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">&amp;&amp;NULLDS,DISP<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(NEW,PASS),SPACE<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(TRK,<\/span><span style=\"color: #6cb6ff;\">1<\/span><span style=\"color: #adbac7;\">),<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">           DCB<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(RECFM<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">FB,LRECL<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #6cb6ff;\">80<\/span><span style=\"color: #adbac7;\">,BLKSIZE<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #6cb6ff;\">80<\/span><span style=\"color: #adbac7;\">) (NULLFILE)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">STEP2     EXEC PGM<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">ANOTHERPGM<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">INPUT1    DD DSN<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">&amp;&amp;TEMPDS,DISP<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(OLD,<\/span><span style=\"color: #f47067;\">DELETE<\/span><span style=\"color: #adbac7;\">)  (<\/span><span style=\"color: #f47067;\">Using<\/span><span style=\"color: #adbac7;\"> temporary <\/span><span style=\"color: #f47067;\">data<\/span> <span style=\"color: #f47067;\">set<\/span> <span style=\"color: #f47067;\">as<\/span> <span style=\"color: #f47067;\">input<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/<\/span><span style=\"color: #adbac7;\">INPUT2    DD DSN<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">&amp;&amp;NULLDS,DISP<\/span><span style=\"color: #f47067;\">=<\/span><span style=\"color: #adbac7;\">(OLD,<\/span><span style=\"color: #f47067;\">DELETE<\/span><span style=\"color: #adbac7;\">)  (<\/span><span style=\"color: #f47067;\">Using<\/span><span style=\"color: #adbac7;\"> NULLFILE <\/span><span style=\"color: #f47067;\">as<\/span> <span style=\"color: #f47067;\">input<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/\/OUTPUT<\/span><span style=\"color: #adbac7;\">    DD <\/span><span style=\"color: #6cb6ff;\">SYSOUT<\/span><span style=\"color: #f47067;\">=*<\/span><span style=\"color: #adbac7;\">                        (<\/span><span style=\"color: #f47067;\">Output<\/span><span style=\"color: #adbac7;\"> will be printed <\/span><span style=\"color: #f47067;\">in<\/span><span style=\"color: #adbac7;\"> the <\/span><span style=\"color: #6cb6ff;\">sysout<\/span><span style=\"color: #adbac7;\">)<\/span><\/span>\r\n<span class=\"line\"><span style=\"color: #f47067;\">\/*<\/span><\/span><\/code><\/pre>\r\n<\/div>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">\u00a0<\/pre>\r\n\r\n\r\n\r\n<p>In this example, the program COBOLPGM generates some data, which we store in a temporary data set (&amp;&amp;TEMPDS). Additionally, we create a NULLFILE (&amp;&amp;NULLDS) to process the same data without consuming any resources.<\/p>\r\n\r\n\r\n\r\n<p>In STEP2, we use both the temporary data set and the NULLFILE as inputs for ANOTHERPGM. This allows us to perform multiple operations on the generated data without the need to store it permanently.<\/p>\r\n\r\n\r\n\r\n<p><strong>Conclusion:<\/strong><\/p>\r\n\r\n\r\n\r\n<p>In conclusion, DUMMY and NULLFILE are two distinct concepts in mainframe programming. DUMMY files act as placeholders to fulfill data set requirements when no actual data is available. On the other hand, NULLFILEs provide a more advanced and efficient way to process data without consuming additional resources.<\/p>\r\n\r\n\r\n\r\n<p>As a mainframe programmer, understanding the differences between DUMMY and NULLFILE is essential for optimizing job executions, conserving system resources, and handling various data scenarios effectively. By utilizing these techniques appropriately, developers can enhance the efficiency and performance of their mainframe applications.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Understanding the Difference Between DUMMY and NULLFILE in Mainframes Introduction: Mainframes have been an integral part of the computing industry [&hellip;]<\/p>\n","protected":false},"author":515,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[424,306,426,421,46,428,422,427],"class_list":["post-1532","post","type-post","status-publish","format-standard","hentry","category-jcl","tag-characteristics-of-nullfiles","tag-cobol-2","tag-definition-of-nullfiles","tag-dummy-in-mainframes","tag-jcl","tag-job-control-language","tag-nullfile-in-mainframes","tag-using-nullfiles-in-jcl"],"amp_enabled":true,"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"zMainframes","author_link":"https:\/\/zmainframes.com\/zlog\/author\/zmainframes\/"},"rttpg_comment":1,"rttpg_category":"<a href=\"https:\/\/zmainframes.com\/zlog\/mainframes\/jcl\/\" rel=\"category tag\">JCL<\/a>","rttpg_excerpt":"Understanding the Difference Between DUMMY and NULLFILE in Mainframes Introduction: Mainframes have been an integral part of the computing industry [&hellip;]","_links":{"self":[{"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/posts\/1532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/users\/515"}],"replies":[{"embeddable":true,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/comments?post=1532"}],"version-history":[{"count":3,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/posts\/1532\/revisions"}],"predecessor-version":[{"id":1971,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/posts\/1532\/revisions\/1971"}],"wp:attachment":[{"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/media?parent=1532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/categories?post=1532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zmainframes.com\/zlog\/wp-json\/wp\/v2\/tags?post=1532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}