I want to write a SAS/IML debugging module that I can call with an argument that may be numerical, character, or a list or a table.
This module would print varying messages conditional upon the data type, e.g., 'N', 'C', or, let's say, 'L' for a list, and 'T' for a table.
Is there a SAS/IML function that is similar to the DATA STEP vartype() function that I can use to return the data type of an argument to a module?
The "call struct()" module gives me good information. Is there some way to utilize this module as a function so that I may conditionally execute code based on the contents of a data structure?
In IML the function is called TYPE() and works exactly how you are expecting, for example:
x = 4;
if type(x)='N' then do;
/* x is numeric so OK to do stuff... */
x = x # 3;
print x;
end;
In IML the function is called TYPE() and works exactly how you are expecting, for example:
x = 4;
if type(x)='N' then do;
/* x is numeric so OK to do stuff... */
x = x # 3;
print x;
end;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.