I like to replace the following column name assignment:
x = {:Name("Lot name"));
by a variable list which contains a list of column names from a table. Say the list is:
var_list = {"Lot name", "Location", "Cost", ...}.
All following are giving me errors:
x = {:Name(var_list[1])};
x = {:Name(char(eval(var_list[1]))};
...
Any good suggestion?
Thanks.
John
What type of SAS system or proc are you running and how is var_list being created?
Oops! I mean: using JMP/JSL scripting. Not in SAS.
You will probably have more success, then, reposting your question in the JMP forum.
Is this useful:
Reeza - thank you for providing the reference link, but not exactly what I need, or at least I cannot find the solution from it yet. Here is what I like to do:
For example, I have a table dt with n columns, X1, X2, ..., Xn. I need to draw distributions for EACH column, X(i), like below (repeat n times):
Distribution(
Continuous Distribution(
Column( :X1),
Horizontal Layout( 1 ),
Vertical( 0 ),
Normal Quantile Plot( 1 ),
Capability Analysis( LSL( 4 ), USL( 22 ), Target( 13 ) )
)
);
How can I use a loop to do this? I tried the following, but it is not successful :-(.
ColNameList = dt << Get Column Names(Nominal, String);
for (k=1, k<=n, k++,
Distribution(
Continuous Distribution(
Column( :ColNameList
Horizontal Layout( 1 ),
Vertical( 0 ),
Normal Quantile Plot( 1 ),
Capability Analysis( LSL( 4 ), USL( 22 ), Target( 13 ) )
)
)
);
It is useful. Thanks.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.