<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dataset-Abfragen unter z/OS: DSN da? DSN leer? / English: Dataset under z/OS exists? Dataset is empty? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172315#M33124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I want to distriute some coding to our users. they shouldt be able to test, in batchjobs on z/OS, if a simple sequential file exists.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Furthermore&amp;nbsp; they should be able to test if that existing dataset is empty .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This question is not posted fpr SAS-Datasets/-libraries, but for z/OS Datasets &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking about something like the&amp;nbsp; %SYSFUNC statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for help or information!&lt;/P&gt;&lt;P&gt;Engelbert Smets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hallo!&lt;/P&gt;&lt;P&gt;Ich möchte unseren Benutzern eine Möglichkeit bieten im Batchjob unter z/OS&lt;/P&gt;&lt;P&gt;abzufragen, ob&lt;/P&gt;&lt;P&gt;- eine Datei, z.B. zugeordnet über JCL oder filename, exitiert&lt;/P&gt;&lt;P&gt;- eine Datei, z.B. zugeordnet über JCL oder filename, exitiert, aber leer ist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wohlgemerkt, es handelt sich dabei nicht um eine SAS-DAtei, sondern um ander übliche z/OS-Dateien.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im Hinterkopf denke ich da an %SYSFUNC oder so etws.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vielen Dank für Unterstützung!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Engelbert Smets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Dec 2013 07:27:53 GMT</pubDate>
    <dc:creator>PEP3_Team</dc:creator>
    <dc:date>2013-12-13T07:27:53Z</dc:date>
    <item>
      <title>Dataset-Abfragen unter z/OS: DSN da? DSN leer? / English: Dataset under z/OS exists? Dataset is empty?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172315#M33124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I want to distriute some coding to our users. they shouldt be able to test, in batchjobs on z/OS, if a simple sequential file exists.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Furthermore&amp;nbsp; they should be able to test if that existing dataset is empty .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This question is not posted fpr SAS-Datasets/-libraries, but for z/OS Datasets &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking about something like the&amp;nbsp; %SYSFUNC statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for help or information!&lt;/P&gt;&lt;P&gt;Engelbert Smets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hallo!&lt;/P&gt;&lt;P&gt;Ich möchte unseren Benutzern eine Möglichkeit bieten im Batchjob unter z/OS&lt;/P&gt;&lt;P&gt;abzufragen, ob&lt;/P&gt;&lt;P&gt;- eine Datei, z.B. zugeordnet über JCL oder filename, exitiert&lt;/P&gt;&lt;P&gt;- eine Datei, z.B. zugeordnet über JCL oder filename, exitiert, aber leer ist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wohlgemerkt, es handelt sich dabei nicht um eine SAS-DAtei, sondern um ander übliche z/OS-Dateien.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im Hinterkopf denke ich da an %SYSFUNC oder so etws.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vielen Dank für Unterstützung!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Engelbert Smets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 07:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172315#M33124</guid>
      <dc:creator>PEP3_Team</dc:creator>
      <dc:date>2013-12-13T07:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset-Abfragen unter z/OS: DSN da? DSN leer?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172316#M33125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Die Chance eine Antwort zu bekommen, ist viel grösser wenn die Frage auf English gestellt wird.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS stellt die &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#n06xm8hwk0t0axn10gj16lfiri43.htm"&gt;FILEEXIST &lt;/A&gt;und &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0gh473azqo3han1edlhbyt04gxa.htm"&gt;FEXIST &lt;/A&gt;zur Verfügung. Mit diesen Funktionen kann geprüft werden ob ein File existiert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Um festzustellen, ob das File leer ist, muss man das File lesen, zum Beispiel mit dem DATA Step&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 07:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172316#M33125</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2013-12-13T07:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset-Abfragen unter z/OS: DSN da? DSN leer? / English: Dataset under z/OS exists? Dataset is empty?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172317#M33126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mit das Deutsch wurde ich auch auskommen. De meiste guten Handbücher und Internet Seiten sind&lt;BR /&gt;aber im English.&amp;nbsp; Lassen wir es zum English halten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JCL (Job Control Language) and dataset access at the z/OS mainframe are behaving very different ot what is common at Windows or Unix.&lt;/P&gt;&lt;P&gt;That is:&lt;/P&gt;&lt;P&gt;- You cannot put an non-existing dataset into JCL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; JES-2 is skipping the job before something has run.&amp;nbsp;&amp;nbsp; (first JCL-step)&lt;/P&gt;&lt;P&gt;- The locking on datasets is very strict organized by the use of the DISP (OLD NEW SHR).&lt;/P&gt;&lt;P&gt;&amp;nbsp; There are exceptions ont some types like PDS-E&amp;nbsp; or using the HFS naming approach like common in UNIX.&lt;/P&gt;&lt;P&gt;&amp;nbsp; That last approach is very unusual for the oldies of mainframes but it is possibe as the kernal is there.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;- Jobs that are run by a scheduler (eg TWS) normally require the verfivying of time and datasets being used/. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS has dedicated manual for specific Mainframe SAS language: &lt;A href="http://support.sas.com/documentation/cdl/en/hosto390/65144/HTML/default/viewer.htm#n0v4avfsij6ogvn1oedewmj0820c.htm" title="http://support.sas.com/documentation/cdl/en/hosto390/65144/HTML/default/viewer.htm#n0v4avfsij6ogvn1oedewmj0820c.htm"&gt;SAS(R) 9.3 Companion for z/OS, Second Edition&lt;/A&gt; (DSNexist)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are your options (You have to check with your IT support):&lt;/P&gt;&lt;P&gt;- bypass the TWS requirements and code SAS like the DSNexist sample&lt;/P&gt;&lt;P&gt;- use the TWS verifying/trigger whether a dataset exist. normally as a trigger from an other job.&amp;nbsp; &lt;/P&gt;&lt;P&gt;- Build a first step in the JCL that check the dataset dynamically and you next JCL-Steps being executed conditionally&lt;/P&gt;&lt;P&gt;- use a HFS-datasetname.&lt;/P&gt;&lt;P&gt;- Use the PDS-E approach als members in a shared library are not checked as long as you do not give mebernames&lt;/P&gt;&lt;P&gt;- use dummy-datasets with&amp;nbsp; zero records to have valid datasetnames for the JCL-JEs2 step&lt;/P&gt;&lt;P&gt;- Use concatenation of datasets with a default empty datset to be overwritten&lt;/P&gt;&lt;P&gt;- With the SAS input function use the file-var&amp;nbsp; filename option to check the real datasetname&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the goal is a collection of inputdatsets I would advice a PDS-E setup up as VBS with a lrecl of 32Kn (maximum) and a blocksize of half-track 3390.&lt;/P&gt;&lt;P&gt;That is the closest to the suequential way of thinking at Unix/Windos.&lt;/P&gt;&lt;P&gt;A Unix type (HFS) approach would be even easier but very hard to get done when your IT staff does not want you to help with that.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Dec 2013 19:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172317#M33126</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-12-14T19:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset-Abfragen unter z/OS: DSN da? DSN leer? / English: Dataset under z/OS exists? Dataset is empty?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172318#M33127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FILEEXIST() should be able to test if a file exists.&amp;nbsp; You could also try using the FOPEN() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy way to test if a file has zero records is to read it.&amp;nbsp; For example this will set the macro variable EMPTY to 1 when there are no records in the file referenced by the filename (or DD name on MVS) of MYFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let empty=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then call symputx('EMPTY','1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile MYFILE&amp;nbsp; end=eof ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Dec 2013 21:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-Abfragen-unter-z-OS-DSN-da-DSN-leer-English-Dataset/m-p/172318#M33127</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-14T21:20:21Z</dc:date>
    </item>
  </channel>
</rss>

