BookmarkSubscribeRSS Feed
Arjumand
Calcite | Level 5

Hi,

 

I am fetching data from a textbox and storing it in an SCL list. The code is below:-

 


Reasonlist= makelist();

ReasonTxt._getData(Reasonlist);

reason="";
if listlen(Reasonlist) ne 0
then do;
do i = 1 to listlen(Reasonlist);
reason=reason||trim(getitemc(Reasonlist,i))||" ";
end;
end;


* check if reason for revision is completed *;
if lengthn(reason)<=0
then do;
commandlist=makelist();
commandlist=insertc(commandlist, 'Please provide Reason for Revision.',1);
command=messagebox(commandlist,'S','O',"ERROR");
commandlist=dellist(commandlist);
rc = dellist(Reasonlist);
return;
end;

 

There is a message box which prompts error when the text is not provided.

 But I am getting this error even if I enter text in the textbox.This generally happens when at the end of the text, I press the enter key. How to convert this new line at the end of the text to space? Please help.


Revision.png
2 REPLIES 2
BrunoMueller
SAS Super FREQ

Hi

 

I changed some of the code just a little like this:

DISPLAY:
Reasonlist = ReasonTxt.Text;

call putlist(Reasonlist, "Reasonlist", 2);

reason=" ";
...

Sometimes when entering newlines(the enter key), no SCL List is returned.

 

I suggest you contact Tech Support

 

Bruno

BrunoMueller
SAS Super FREQ

The problem comes from an invalid list returned, when pressing the enter key, this does not always happen.

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1923 views
  • 0 likes
  • 2 in conversation