Desktop productivity for business analysts and programmers

Required operator not found - but code/prompt works in a stored process

Reply
Occasional Contributor
Posts: 6

Required operator not found - but code/prompt works in a stored process

Hello,

i am getting this error if i do for example a substr(xx,1,4) AS xx2.

I implemented the code in a prompt associated with an EG programm file, and it doenst work with BIGINT, table gets not created...but it does work on an other colum(VARCHAR), with the same error.

 

The BIGINT column code works on a same generated prompt in a stored process and the log doenst show me the error (didnt tested if the VARCHAR works, but i assume it works too).

 

So im a bit confused?! How to clean the errors on the normal EG project programm and get this work with the BIGINT column?

 

I tried it with %sysfunc(%quote(substr(xx,1,4) AS xx2)) but that doesnt work.

 

Just to understand, i put the whole substr(xx,1,4) AS xx2 in the prompt (unformated value), its in a static list and then i chose the value(formated displayed value) and take the function behind it, in this case the substr...

This works in a stored process with a simple prompt, but not 100% in a normal SAS EG promp associated with a program.

Super User
Super User
Posts: 9,211

Re: Required operator not found - but code/prompt works in a stored process

Stored processes and EG Prompts are two very different things.  EG prompts are (as far as I can remember) only there to create macro variables with some data as chosen by the user, so putting code in there is not really going to work - nor is it a very good idea in the best of cases as it could seriously impact the integrity of your system (its called SQL injection).

Occasional Contributor
Posts: 6

Re: Required operator not found - but code/prompt works in a stored process

It works..because the code is the "data" that gets chosen.

SQL injection on a server from outside, ok nothing new...but why or how could something like a substr or something else could impact on a system?
Its just a written query, what the difference between this type of query or put that hardcoded in a sas program?
Super User
Super User
Posts: 7,860

Re: Required operator not found - but code/prompt works in a stored process

How do you expect SAS (or any computer language) to run a character function like SUBSTR() on a numeric variable like BIGINT value?

Ask a Question
Discussion stats
  • 3 replies
  • 104 views
  • 0 likes
  • 3 in conversation