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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.