Hi community,
I'm not sure if my output is correct for this array problem. Any suggestions are greatly appreciated. Thank you!
1. Set up arrays to meet the following requirements:
Array math has three elements, Jan, Feb and Mar. Their initial values are “January”, “February” and “March”.
Since the array statement will be the first reference to these variables, pay particular attention to their length.;
Below is my answer:
data b; array math (3) Jan Feb Mar; do i=1 to 3; end; proc print; run; Obs Jan Feb Mar i 1 . . . 4
@Amy0223 wrote:
Hi community,
I'm not sure if my output is correct for this array problem. Any suggestions are greatly appreciated. Thank you!
1. Set up arrays to meet the following requirements:
Array math has three elements, Jan, Feb and Mar. Their initial values are “January”, “February” and “March”.
Since the array statement will be the first reference to these variables, pay particular attention to their length.;
Below is my answer:
data b; array math (3) Jan Feb Mar; do i=1 to 3; end; proc print; run; Obs Jan Feb Mar i 1 . . . 4
I think this is not a situation where arrays are needed! But ... it seems as if the answer is expected to contain usage of arrays. And thus a very poor question.
Nevertheless
array math {3} $ 8 jan feb mar ('January','February','March');
@Amy0223 wrote:
Hi community,
I'm not sure if my output is correct for this array problem. Any suggestions are greatly appreciated. Thank you!
1. Set up arrays to meet the following requirements:
Array math has three elements, Jan, Feb and Mar. Their initial values are “January”, “February” and “March”.
Since the array statement will be the first reference to these variables, pay particular attention to their length.;
Below is my answer:
data b; array math (3) Jan Feb Mar; do i=1 to 3; end; proc print; run; Obs Jan Feb Mar i 1 . . . 4
I think this is not a situation where arrays are needed! But ... it seems as if the answer is expected to contain usage of arrays. And thus a very poor question.
Nevertheless
array math {3} $ 8 jan feb mar ('January','February','March');
This will do
data b;
array math{3} $ Jan Feb Mar ('January' 'February' 'March');
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.