BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mwhemke
Calcite | Level 5

Hello,

I just want some clarification for a homework question.

"Suppose a multi-site study will be conducted across 40 study sites.  Write a DATA step which creates a data set named ‘SiteInfo’ and contains a single variable named ‘SiteID’ which contains values from 1 to 40 inclusive.  Hint:  Use a DO loop!"

Specifically, if the values are to be 1 to 40 inclusive, what does that wording mean?

Thank you.

 

1 ACCEPTED SOLUTION
2 REPLIES 2
ballardw
Super User

@mwhemke wrote:

Hello,

I just want some clarification for a homework question.

"Suppose a multi-site study will be conducted across 40 study sites.  Write a DATA step which creates a data set named ‘SiteInfo’ and contains a single variable named ‘SiteID’ which contains values from 1 to 40 inclusive.  Hint:  Use a DO loop!"

Specifically, if the values are to be 1 to 40 inclusive, what does that wording mean?

Thank you.

 


Feeling a bit obnoxious this morning so:  [1,40]

 

Mathematicians use different symbols for intervals with the [ and ] mean "include the end point on that side". As opposed to ( and ) which mean "include values up to but not actually equal to" the value: (1,40] would exclude 1 but include 40 for example. This is bit more precise and much shorter than the narrative. 

 

Hint the second: and an Output statement.

 

From a specification aspect I would request clarification if the values should be character or numeric. Identifiers often should not be numeric if you are not going to do arithmetic with them. The difference is somewhat important when you have multiple anything. If one site records the data as character and another as numeric you will find you have issues with combining the data later. So specify first, code second.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 361 views
  • 0 likes
  • 3 in conversation