BookmarkSubscribeRSS Feed
LineMoon
Lapis Lazuli | Level 10

Hello,

Please, I would why when we call some sas function (ex: upcase, lowercase, ...) , sas sends an error message, it does not regonize the function.  why ? and how can we  identify the main raison for the matter ? is it a question of package ? 

 

34 REPLIES 34
mkeintz
PROC Star

Example, with log please.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Reeza
Super User

Because it's not a valid function in the manner you're trying to use it. 

 

SAS functions are upcase and lowcase (low vs lower). SAS SQL allows upper/lower to work to convert case as well, but those won't work in a data step. 

 

FEDSQL has a set of specific functions available.

IML has a different set of functions.

SAS SQL has a few different ones as well. 

If you're using SQL Pass Thru you need to use the native DB functions, ie Oracle or T-SQL.

 

If you try to use an IML function in SAS SQL its not going to work, except there are overlaps. For example up until 9.4 the median function worked in PROC SQL but wasnt' what you expect. 

 

Find the relevant sections of the docs and bookmark them for reference. 

 

 

LineMoon
Lapis Lazuli | Level 10

@ll: Thank you all.

I think, it can be a question of prfil or sas package ?

So, how can we check , if the function existes ? and why it does not existe ?

Reeza
Super User

Read the documentation. 

LineMoon
Lapis Lazuli | Level 10

which one ?

LineMoon
Lapis Lazuli | Level 10
ballardw
Super User

Start by running this code:

proc format library=work;
value poorothergrp
0 -<14 ='Top'
14 - 30='Bottom';
run;

Which will give the names of currently available functions and some other info.

 

There may be some that are in the result that aren't generally documented or apply to products that you don't have licensed or only apply to some operating systems

LineMoon
Lapis Lazuli | Level 10

@ballardw : Thank you

Until now, I do  not know see that  ?, when I use this code

proc format library=work;

value poorothergrp

0 -<14 ='Top'

14 - 30='Bottom';

run;

 

data test;

v=3;

y=max(7,8);

run;

 

proc format

library = work;

select poorothergrp;

run;

ballardw
Super User

@LineMoon wrote:

@ballardw : Thank you

Until now, I do  not know see that  ?, when I use this code

proc format library=work;

value poorothergrp

0 -<14 ='Top'

14 - 30='Bottom';

run;

 

data test;

v=3;

y=max(7,8);

run;

 

proc format

library = work;

select poorothergrp;

run;


Are you attempting to get the description of the format? You need to tell the procedure which catalog to look at.

Perhaps you are wanting:

proc format library = work fmtlib;
  select poorothergrp;
run;

to use the default FORMATS catalog in the work library.

 

LineMoon
Lapis Lazuli | Level 10

@ballardw :

thank you.

proc format library = work fmtlib;

select poorothergrp;

run;

 

So, I have used it, I see in "result", the format of poorothergrp.

But, I do not get the informations about the functions : max,...

ballardw
Super User

@LineMoon wrote:

@ballardw :

thank you.

proc format library = work fmtlib;

select poorothergrp;

run;

 

So, I have used it, I see in "result", the format of poorothergrp.

But, I do not get the informations about the functions : max,...


what are you looking for? You haven't said. Proc FORMAT will only return information about FORMATS, not functions. The code for the dictionary.functions, save as sashelp.vfunc, lists the names of valid functions and a little bit about it, not syntax or behavior. That is what documentation contains. You might try looking at your online help from SAS for Base SAS and functions

Reeza
Super User

@ballardw I think the code you posted may have been intended for another question. Proc Format doesn't come into play when searching for functions.

 

The documentation is the source of truth, bible, gold standard, etc. 

Reeza
Super User

SASHELP.VFUNC

 

 

If you ever want listings of something look at the SASHELP tables.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 34 replies
  • 1695 views
  • 17 likes
  • 8 in conversation