Hello Everyone,
I am a little stuck on this problem for my homework.
The problem is:
I have tried to look at the online doc for help on this, but I could not find a SAS File I/O function that would work for the program that I have currently:
proc fcmp outlib=work.functions.Marketing;
function Nums(dataset) $40;
return (open(dataset));
endsub;
run;
quit;
*part b;
data _null_;
x=Nums('orion.Internet');
put x=;
run;
Could someone please let me know what SAS File I/O I should use in order for this program to return correctly?
Thanks,
Alisa
proc fcmp;
function num(dataset $);
dsid=open(dataset);
nobs=attrn(dsid,"nobs");
rc=close(dsid);
return(nobs);
endsub;
test=num('sashelp.class');
put test;
run;
proc fcmp;
function num(dataset $);
dsid=open(dataset);
nobs=attrn(dsid,"nobs");
rc=close(dsid);
return(nobs);
endsub;
test=num('sashelp.class');
put test;
run;
Thanks FriedEgg! This was very helpful!
Nice to get help from another Coloradan!
Cheers!
Alisa
If you are a student keep me in mind when you are ready to search for a job. I am almost always looking for to hire one or two SAS users at varying levels. Currently I have two positions open for expert level positions and I just closed one for an entry level SAS user.
Hi FE,
Does your company allow working remotely? Thank you!
Not for entry level positions. Typically we will only have programmers working remotely after they have already worked in one of our offices for an extended period of time. Especially for beginner and intermediate level positions. One of the positions I have at this time could work from our office in New York instead of Colorado, this would be for an expert level SAS statistical programmer and researcher.
Here are the positions I currently have available:
Statistical Analyst - Harrison, New York (remote possible, but unlikely)
Sr. Statistical Analyst - Harrison, New York (remote is a possibility)
Thank you!!! -Linlin
Hi FriedEgg,
I will definitely keep you in mind! I am currently working on my Prob-Stat undergrad at Metro and I will be graduating Sprint 2013.
Do you have a LinkedIn page?
Cheers!
Alisa
There is a link to my LinkedIn page on my profile for this site. Just click on my name.
Good code, but a slight change is in order. The number of "logical" observations is a slightly different attribute: nlobs instead of nobs
There is rarely a difference. NOBS is the total number of observations, which is unaffected by observations that have been interactively marked for deletion but not yet physically removed from the data set. NLOBS is reduced by the number of observations that have been marked for deletion. The L in NLOBS is for "Logical".
Astounding,
NLOBS is a good recommendation, it aids in situations where as you said, you have deleted records, and also cases where you use the file operation functions to apply where clauses to datasets and other things as well.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.