%macro chk_dir(dir=);
data _null_;
/*_dir=strip("&dir");*/
sti=scan("&dir",-1,'\');
folder=reverse(subpad(reverse("&dir"),index(reverse("&dir"),'\')+1));
newdir1=dcreate(sti,folder);
if newdir1 ne '' then
put "NOTE: Directory &dir is created";
run;
%mend chk_dir;
%MACRO DOWNLOAD_SAS_BIB(DSN);
%let path=c:\new;
%chk_dir(dir=&path.\&DSN);
LIBNAME OUTME "&path.\&DSN";
OPTIONS VALIDVARNAME=any;
%SYSLPUT DSN=&DSN;
RSUBMIT;
OPTIONS VALIDVARNAME=any;
LIBNAME GETME "&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="&_host_user" password="&_host_pass" noscript;
%DOWNLOAD_SAS_BIB(&BIB.);
%END;
%MEND TEST1;
%TEST1(SKJH.UVT.SAS);
%TEST1(SB24.NEW.SAS);
What I am doing in this program is I am downloading the SAS dataset from mainframe to windows
When I am running the program with this dataset SKJH.UVT.SAS it is running fine
but when I am running with this dataset SB24.NEW.SAS it shows me the error
ERROR: Cannot open data library GETME because it is uninitialized and user has only read access.
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
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
... View more