In JMP/JSL, how to use a global variable/list for a column assignment?

Reply
Occasional Contributor
Posts: 9

In JMP/JSL, how to use a global variable/list for a column assignment?


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

PROC Star
Posts: 7,492

Re: how to use a global variable/list for a column assignment?

What type of SAS system or proc are you running and how is var_list being created?

Occasional Contributor
Posts: 9

Re: how to use a global variable/list for a column assignment?

Oops! I mean: using JMP/JSL scripting. Not in SAS.

PROC Star
Posts: 7,492

Re: how to use a global variable/list for a column assignment?

You will probably have more success, then, reposting your question in the JMP forum.

Super User
Posts: 19,872

Re: In JMP/JSL, how to use a global variable/list for a column assignment?

Occasional Contributor
Posts: 9

Re: In JMP/JSL, how to use a global variable/list for a column assignment?

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 ) )

  )

)

);

Occasional Contributor
Posts: 9

Re: In JMP/JSL, how to use a global variable/list for a column assignment?

It is useful. Thanks.

Ask a Question
Discussion stats
  • 6 replies
  • 1505 views
  • 3 likes
  • 3 in conversation