Igor Khorlo
SAS User Group Germany meetup #3
23rd January 2019 📍 Berlin
ERROR: SUBMIT block:2: attempt to call a table value
stack traceback:
SUBMIT block:2: in function 'iterate'
SUBMIT block:9: in function 'times'
SUBMIT block:13: in main chunk
ERROR: There was an error submitting the provided code
NOTE: The SAS System stopped processing this step because of errors.
ERROR: An unexpected semicolon occurred in the %DO statement. A dummy macro will be compiled.
%do i = 1 %to &n;
%put &i;
%end;
for i = 1, n do
print(i)
end
$ ls -al
-rw-r--r-- 1 sasdemo 88039424 Oct 20 19:57 #tf0024.sas7butl
drwx------ 2 sasdemo 1024 Oct 20 19:57 .
drwx------ 3 sasdemo 96 Oct 20 19:56 ..
-rw-r--r-- 1 sasdemo 12288 Oct 20 19:57 sasmac1.sas7bcat
%let list=George Paul Ringo John Foo Bar Baz Macro Polo;
%do i = 1 %to
%sysfunc(countw(&list));
%let item=%scan(&list, &i);
%put &item;
%end;
list = {"George", "Paul", "Ringo", "John", "Foo", "Bar", "Baz", "Macro", "Polo"}
for _, i in ipairs(list) do
print(i)
end
data class(drop=i);
set sashelp.class;
do i = 1 to 100000;
output;
end;
drop i;
run;
%let dsid = %sysfunc(open(&indat));
%syscall set(dsid);
%let nobs = %sysfunc(attrn(&dsid, nlobs));
%do i=1 %to &nobs;
%let rc = %sysfunc(fetchobs(&dsid, &i));
%end;
%let rc = %sysfunc(close(&dsid));
/* mf_existds.sas */
/* @number */
%macro mf_existds(libds);
%if %sysfunc(exist(&libds)) ne 1 &
%sysfunc(exist(&libds,VIEW)) ne 1 %then 0;
%else 1;
%mend;
%put {%mf_existds(sashelp.class)};
Demo