1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 22:14:35 +00:00

fix: making view an option so that existence can be checked for

This commit is contained in:
2020-11-02 17:15:29 +01:00
parent cc7cc55022
commit a88efacfab
2 changed files with 29 additions and 6 deletions

View File

@@ -20,7 +20,9 @@
@param inref= fileref to the CSV
@param outds= output ds. Could also be a view (eg `outds=myds/view=myds`)
@param outds= output ds (lib.ds format)
@param view= Set to YES or NO to determine whether the output should be
a view or not. Default is NO (not a view).
@param baseds= Template dataset on which to create the input statement.
Is used to determine types, lengths, and any informats.
@@ -34,7 +36,7 @@
%let syscc=4;
%abort;
%end;
%if &outds=0 %then %do;
%if %superq(outds)=0 %then %do;
%put %str(ERR)OR: the OUTDS variable must be provided;
%let syscc=4;
%return;
@@ -44,6 +46,11 @@
%let syscc=4;
%return;
%end;
%if %sysfunc(exist(&BASEDS)) ne 1 & %sysfunc(exist(&BASEDS,VIEW)) ne 1 %then %do;
%put %str(ERR)OR: the BASEDS dataset needs to be assigned, and to exist;
%let syscc=4;
%return;
%end;
/* get the variables in the CSV */
data _data_;
@@ -100,7 +107,11 @@ data _null_;
run;
/* import the CSV */
data &outds;
data &outds
%if %upcase(&view)=YES %then %do;
/view=&outds
%end;
;
infile &inref dsd firstobs=2;
input &instat;
drop &dropvars;