I was computing a temp variable with proc imstat:
crosstab re_subj*bigsmall/ tempnames=bigsmall tempexpress="if number='big' then bigsmall='bigger ';
else bigsmall='smaller';";
run;
The values for 'smaller' is 1-character shorter, i.e. 'smalle' instead. Therefore, I assume it is a variable length problem, like in data step. Is there any way to fix the issue in proc imstat.
Thanks
Sure. Here is the info:
module: Module 2: Big Data Programming and Loading
course: Getting Started with SAS® In-Memory Statistics
lesson: Chapter 3 Exercise 2-b
Thanks
Hi:
What the instructors said was that:
"There is no way to control the length of a temp variable in IMSTAT, that I know of. You have to use different logic to work your way into it. I would advise them to reverse the logic. The longer variable value is now assigned first and should fix the issue.
tempexpress="if number NE 'big' then bigsmall='smaller ';
else bigsmall='bigger';";
By putting the larger value first, the length will be set based on the length of the first string in the assignment for the BIGSMALL variable."
Hope this helps,
Cynthia
Many thanks for the solution. Alternatively, can blank spaces be used to pack it up like this?
tempexpress="if number NE 'big'
then bigsmall='bigger ';
else bigsmall='smaller';";
There is an empty space after the text in 'bigger'. it should also work, right?
Jason
This is a knowledge-sharing community for learners in the Academy. Find answers to your questions or post here for a reply.
To ensure your success, use these getting-started resources:
Estimating Your Study Time
Reserving Software Lab Time
Most Commonly Asked Questions
Troubleshooting Your SAS-Hadoop Training Environment
Ready to level-up your skills? Choose your own adventure.