<?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: Downloading the SAS dataset from mainframe to windows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512473#M138047</link>
    <description>&lt;P&gt;I took the liberty of editing your code so that it is easier to read. Note that you have a suprlus %END in macro TEST1.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 08:42:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-13T08:42:56Z</dc:date>
    <item>
      <title>Downloading the SAS dataset from mainframe to windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512453#M138033</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro chk_dir(dir=);
&lt;BR /&gt;data _null_;
/*_dir=strip("&amp;amp;dir");*/
sti=scan("&amp;amp;dir",-1,'\');
folder=reverse(subpad(reverse("&amp;amp;dir"),index(reverse("&amp;amp;dir"),'\')+1));
newdir1=dcreate(sti,folder);
if newdir1 ne '' then
  put "NOTE: Directory &amp;amp;dir is created";
run;

%mend chk_dir;

%MACRO DOWNLOAD_SAS_BIB(DSN);

%let path=c:\new;

%chk_dir(dir=&amp;amp;path.\&amp;amp;DSN);

LIBNAME OUTME "&amp;amp;path.\&amp;amp;DSN";

OPTIONS VALIDVARNAME=any;

%SYSLPUT DSN=&amp;amp;DSN;

RSUBMIT;&lt;BR /&gt;
  OPTIONS VALIDVARNAME=any;

  LIBNAME GETME "&amp;amp;DSN." DISP=OLD;

  OPTIONS OBS=MAX;

  PROC DOWNLOAD INLIB=GETME OUTLIB=OUTME V6TRANSPORT;
  RUN;

  LIBNAME GETME CLEAR;

ENDRSUBMIT;

%MEND DOWNLOAD_SAS_BIB;

%MACRO TEST1(BIB);

OPTIONS COMAMID = TCP;  

signon Rsysv  user="&amp;amp;_host_user" password="&amp;amp;_host_pass" noscript;

%DOWNLOAD_SAS_BIB(&amp;amp;BIB.);

%END;

%MEND TEST1;

%TEST1(SKJH.UVT.SAS);

%TEST1(SB24.NEW.SAS);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am doing in this program is I am downloading the SAS dataset from mainframe to windows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I am running the program with this dataset SKJH.UVT.SAS it is running fine&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but when I am running with this dataset SB24.NEW.SAS it shows me the error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Cannot open data library GETME because it is uninitialized and user has only read access.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am thinking the error is beacuse this dataset SB24.NEW.SAS when I am opening in mainframe it shows me the error:Invalid block size it is empty and having block size and record length =0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can somebody help me what changes should I make in my code so that when i have dataset with block size and record length =0 it should not run proc download step and program should not be in error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 08:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512453#M138033</guid>
      <dc:creator>shubham1</dc:creator>
      <dc:date>2018-11-13T08:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Downlaoding the SAS dataset from mainframe to windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512458#M138035</link>
      <description>&lt;P&gt;You don't need DISP = OLD on the LIBNAME you are only reading from DISP = SHR is all you need. Why are you using the V6TRANSPORT option? Removing that will enable SAS to convert the datasets correctly for you.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 05:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512458#M138035</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-11-13T05:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading the SAS dataset from mainframe to windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512473#M138047</link>
      <description>&lt;P&gt;I took the liberty of editing your code so that it is easier to read. Note that you have a suprlus %END in macro TEST1.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 08:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-the-SAS-dataset-from-mainframe-to-windows/m-p/512473#M138047</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-13T08:42:56Z</dc:date>
    </item>
  </channel>
</rss>

