<?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 Re: Accessing Z/OS Datasets from SAS Program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217545#M40076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need to refer a permanent dataset&amp;nbsp; created sometime back , you should use the libname statement to point the the dataset librarary and then you can access the dataset by two level name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If my dataset library is "BAS0000.XXX.YY.DATA" and the Dataset name is HAVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname Mydata 'BAS0000.XXX.YY.DATA';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;P&gt;WANT&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Set &lt;/P&gt;&lt;P&gt;Mydata.HAVE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to refer a Dataset created in the same SAS session&amp;nbsp; but you have to derive the Dataset name dynamically , you can do something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA&lt;/P&gt;&lt;P&gt;WANT&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;HLQ.SLQ.TLQ.A&amp;amp;YYMMDD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FILENAME should be used only when we had to access the OS files like reading or writing to a file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Karthik&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 06:31:55 GMT</pubDate>
    <dc:creator>Karthikeyan</dc:creator>
    <dc:date>2015-04-08T06:31:55Z</dc:date>
    <item>
      <title>Accessing Z/OS Datasets from SAS Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217543#M40074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to access a mainframe dataset (SAS file) from SAS Program.&lt;/P&gt;&lt;P&gt;I cannot pass the Dataset name from JCL as the file name is not fixed.&lt;/P&gt;&lt;P&gt;Eg ... File Name is&amp;nbsp; :&amp;nbsp; HLQ.SLQ.TLQ.A&amp;amp;YYMMDD.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In SAS program I can derive YYMMDD and can be able to make up the File name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I need assistance for how to refer the file name and access it from SAS program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I am trying the following :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Getting current date as : 20150407 in SAS program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%LET FNAME = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;HLQ.SLQ.TLQ.A&amp;amp;YYMMDD;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333330154419px;"&gt;%PUT &amp;amp;FNAME;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FILENAME INFIL "&amp;amp;FNAME"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISP=SHR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DATA WANT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;SET INFIL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The above is giving error. File name is resolving properly (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;HLQ.SLQ.TLQ.A150704) &lt;/SPAN&gt;but its giving me error stating Error in the FILENAME statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;File WORK.INFIL.DATA does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333330154419px;"&gt;Can some one please assist how to access the Dataset (File) from SAS Program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Where as If I pass the the dataset name as &lt;SPAN style="font-size: 13.3333330154419px;"&gt;HLQ.SLQ.TLQ.A150704&lt;/SPAN&gt; from JCL then its working fine (just putting the DD Name mentioned in JCL at SET is working fine).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sree.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 01:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217543#M40074</guid>
      <dc:creator>Sreeni</dc:creator>
      <dc:date>2015-04-08T01:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Z/OS Datasets from SAS Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217544#M40075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is working fine referencing the DDNAME on the SET statement why are you trying to allocate it a second time in SAS? In any case to allocate a SAS data library in SAS you need a LIBNAME statement not a FILENAME statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 02:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217544#M40075</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-04-08T02:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Z/OS Datasets from SAS Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217545#M40076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need to refer a permanent dataset&amp;nbsp; created sometime back , you should use the libname statement to point the the dataset librarary and then you can access the dataset by two level name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If my dataset library is "BAS0000.XXX.YY.DATA" and the Dataset name is HAVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname Mydata 'BAS0000.XXX.YY.DATA';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;P&gt;WANT&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Set &lt;/P&gt;&lt;P&gt;Mydata.HAVE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to refer a Dataset created in the same SAS session&amp;nbsp; but you have to derive the Dataset name dynamically , you can do something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA&lt;/P&gt;&lt;P&gt;WANT&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SET&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;HLQ.SLQ.TLQ.A&amp;amp;YYMMDD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FILENAME should be used only when we had to access the OS files like reading or writing to a file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Karthik&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 06:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217545#M40076</guid>
      <dc:creator>Karthikeyan</dc:creator>
      <dc:date>2015-04-08T06:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Z/OS Datasets from SAS Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217546#M40077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tq very much Karthik .. Your suggestion worked out for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Z-OS-Datasets-from-SAS-Program/m-p/217546#M40077</guid>
      <dc:creator>Sreeni</dc:creator>
      <dc:date>2015-04-08T14:14:09Z</dc:date>
    </item>
  </channel>
</rss>

