BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
imlearningsas
Fluorite | Level 6

 

Hello I've written this code (bellow) from sas learning I got this error I do not understand it.

 

eror.PNG

 

proc fcmp outlib=sasuser.funcs.trial;

   function study_day(intervention_date, event_date);

      n = event_date - intervention_date;
         if n >= 0 then
            n = n + 1;
         return (n);
   endsub;

options cmplib=sasuser.funcs;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @imlearningsas 

 

Are you sure you have write access rights to the SASUSER library?

Please try with the WORK library or any user defined library:

proc fcmp outlib=work.funcs.trial;

   function study_day(intervention_date, event_date);

      n = event_date - intervention_date;
         if n >= 0 then
            n = n + 1;
         return (n);
   endsub;

options cmplib=work.funcs;

View solution in original post

5 REPLIES 5
yabwon
Amethyst | Level 16

Hi,

 

maybe try:

proc fcmp outlib=WORK.funcs.trial;

?

 

All the best

Bart 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



ed_sas_member
Meteorite | Level 14

Hi @imlearningsas 

 

Are you sure you have write access rights to the SASUSER library?

Please try with the WORK library or any user defined library:

proc fcmp outlib=work.funcs.trial;

   function study_day(intervention_date, event_date);

      n = event_date - intervention_date;
         if n >= 0 then
            n = n + 1;
         return (n);
   endsub;

options cmplib=work.funcs;
imlearningsas
Fluorite | Level 6

This should be the problem, I do not have acces.

Thanks

ed_sas_member
Meteorite | Level 14

You're welcome @imlearningsas !

imlearningsas
Fluorite | Level 6
It works, thanks.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1671 views
  • 2 likes
  • 3 in conversation