Hi everyone,
I am trying to dynamically create a dictionary in the CASL. In this case I will not know the dictionary keys until I am iterating through an array creating the dictionary.
Below is example code of what I am trying to do with current output and what I want as an output.
proc cas;
count = {"one", "two", "three"};
do x over count;
print x;
temp_dic.x = "hi there";
end;
print temp_dic;
run;
Current output:
Reading the documentation both the dot and bracket notation should work. I don't understand how the syntax for the dot notation would need to look like but it appears using brackets returns the result you're after.
proc cas;
count = {"one", "two", "three"};
do x over count;
print x;
temp_dict[x] = x;
end;
print temp_dict;
run;quit;
one two three {one=one,two=two,three=three}
Reading the documentation both the dot and bracket notation should work. I don't understand how the syntax for the dot notation would need to look like but it appears using brackets returns the result you're after.
proc cas;
count = {"one", "two", "three"};
do x over count;
print x;
temp_dict[x] = x;
end;
print temp_dict;
run;quit;
one two three {one=one,two=two,three=three}
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: