<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Grabbing Variables by Year/ Maybe an array question? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511370#M2156</link>
    <description>&lt;P&gt;I have a set that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Height_In_1997 Weight_1997 Gender DOB_M DOB_Y Race Height_In_1998 Weight_1998 Height_In_1999 Weight-1999 ... BMI_1997 BMI_1998&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 60 150 2 2 1980 2 61 155 ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did it the long way like Paige suggested so that&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data BMI_Year;
	Set BMI2;
	Year = 1997;
	Height = Height_In_1997;
	Weight = Weight_1997;
	BMI = BMI_1997;
	output;
	Year = 1998;
	Height = Height_In_1998;
	Weight = Weight_1998;
	BMI = BMI_1998;
	output;
	Year = 1999;
	Height = Height_In_1999;
	Weight = Weight_1999;
	BMI = BMI_1999;
	output;
	Year = 2000;
	Height = Height_In_2000;
	Weight = Weight_2000;
	BMI = BMI_2000;
	output;
	Year = 2001;
	Height = Height_In_2001;
	Weight = Weight_2001;
	BMI = BMI_2001;
	output;
	Year = 2002;
	Height = Height_In_2002;
	Weight = Weight_2002;
	BMI = BMI_2002;
	output;
	Year = 2003;
	Height = Height_In_2003;
	Weight = Weight_2003;
	BMI = BMI_2003;
	output;
	Year = 2004;
	Height = Height_In_2004;
	Weight = Weight_2004;
	BMI = BMI_2004;
	output;
	Year = 2005;
	Height = Height_In_2005;
	Weight = Weight_2005;
	BMI = BMI_2005;
	output;
	Year = 2006;
	Height = Height_In_2006;
	Weight = Weight_2006;
	BMI = BMI_2006;
	output;
	Year = 2007;
	Height = Height_In_2007;
	Weight = Weight_2007;
	BMI = BMI_2007;
	output;
	Year = 2008;
	Height = Height_In_2008;
	Weight = Weight_2008;
	BMI = BMI_2008;
	output;
	Year = 2009;
	Height = Height_In_2009;
	Weight = Weight_2009;
	BMI = BMI_2009;
	output;
	Year = 2010;
	Height = Height_In_2010;
	Weight = Weight_2010;
	BMI = BMI_2010;
	output;
	Year = 2011;
	Height = Height_In_2011;
	Weight = Weight_2011;
	BMI = BMI_2011;
	output;
	Year = 2013;
	Height = Height_In_2011;
	Weight = Weight_2013;
	if height &amp;gt;0 and weight&amp;gt; 0 then BMI =((Weight_2013*703)/((Height_In_2011)**2));
	output;
	Year = 2015;
	Height = Height_In_2011;
	Weight = Weight_2015;
	if height &amp;gt;0 and weight&amp;gt; 0 then BMI =((Weight_2015*703)/((Height_In_2011)**2));
	output;
	Drop BMI_1997-BMI_2011 Height_In_1997-Height_In_2011 Weight_1997-Weight_2015;
	Label Gender = "1= Male, 2=Female"
		DOB_M = "Date of Birth Month"
		DOB_Y = "Date of Birth Year"
		Race = 1= "Black", 2= "Hispanic", 3= "Mixed Race (Non-Hispanic)" 4= "Non-Black / Non-Hispanic"
		Year= "Year the Survey took place"
		Height = "Height in Inches"
		Weight = "Weight in pounds";
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But&amp;nbsp; I was wondering how you would do that same thing in an array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping and being so kind! I can't speak for everyone, but its often humbling having to post on this forum. However, it has helped me learn rather quickly the tips and tricks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Joe&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2018 13:52:25 GMT</pubDate>
    <dc:creator>joebacon</dc:creator>
    <dc:date>2018-11-08T13:52:25Z</dc:date>
    <item>
      <title>Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511113#M2111</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have three very related questions that are simple but I can not figure out.&amp;nbsp;I annotated the code.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do realize my data structure is wonky and I intend to create a year column instead of having these variables but I thought it would be easier to do these transformations this way (Correct me if I am wrong) since it was how I was given the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname NLSY 'U:\My SAS Files\NLSY97\NLSY97_Height_Weight';
run;

data Fix;
set NLSY.nlsy;
array missing _numeric_;
do over missing;
if missing &amp;lt; 0 then missing=.;
end;
run;

Data BMI;
Set Fix;
If Height_F_1997 &amp;gt; 0 then Height_In_1997  = Height_F_1997*12+Height_In_1997; /*Why wouldnt "if not missing" work instead of &amp;lt;0?*/
If Height_F_1998 &amp;gt; 0 then Height_In_1998  = Height_F_1998*12+Height_In_1998;
If Height_F_1999 &amp;gt; 0 then Height_In_1999  = Height_F_1999*12+Height_In_1999;
If Height_F_2000 &amp;gt; 0 then Height_In_2000  = Height_F_2000*12+Height_In_2000;
/*How do you do this all the way through 2011 without copy and pasting?*/
run;


data BMI;
set Fix ;
BMI_97 = (Weight_1997*703)/(Height_In_1997)**2;
BMI_98 = (Weight_1998*703)/(Height_In_1998)**2;
BMI_99 = (Weight_1999*703)/(Height_In_1999)**2;
BMI_00 = (Weight_2000*703)/(Height_In_2000)**2;
/*Exact same question*/
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 18:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511113#M2111</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-07T18:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511115#M2112</link>
      <description>&lt;P&gt;Data (such as year) never belongs in a variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data (such as year) belongs should be a value of a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, a more simple and easier to work with arrangement of the data would have a variable named YEAR, and a variable named Height_F and a variable named Height_IN and then the entire coding is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If Height_F &amp;gt; 0 then Height_IN = Height_F*12 + Height_IN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So a restructuring of your data would seem to be in order, except that involves coding as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
    set old; 
    year=1997; 
    height_f=height_f_1997;
    height_in=height_in_1997;
    output;
    year=1998;
    /* etc. */
    output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I leave it up to you which one is simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of the above can be done via arrays as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even so, I recommend the restructuring as it will make everything you do with this data simpler in the long run.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 18:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511115#M2112</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-11-07T18:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511116#M2113</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data BMI;
Set Fix;
array j(*)Height_F_1997-Height_F_2011;
array k(*)Height_In_1997-Height_In_2011;
do i=1 to dim(j);
if j(i)&amp;gt;0 then j(k)=j(i)*12+j(i);
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if you can follow the above, should get you closer&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 18:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511116#M2113</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-07T18:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511118#M2115</link>
      <description>I follow this for the most part, but why would i reference array k in the "then" statement?&lt;BR /&gt;&lt;BR /&gt;Would it not be if j(i)&amp;gt;0 then k(i)=j(i)*12+k(i);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Either way, thank you! This is exactly what I was looking for.</description>
      <pubDate>Wed, 07 Nov 2018 18:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511118#M2115</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-07T18:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511121#M2116</link>
      <description>&lt;P&gt;Yes my sincere apologies for typo. My bad. I need to get my eyes checked or is it too much caffeine shakes I am having due to addiction. Good catch and well done!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 18:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511121#M2116</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-07T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511128#M2117</link>
      <description>&lt;P&gt;No! Do not be sorry at all. I am just learning and wanted to be sure. Coffee is my lifeblood.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A follow-up question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the second set of arrays, how to initialize BMI as an array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, I have this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data BMI2;
Set BMI;
array Weight(*)Weight_1997-Weight_2011;
array Height(*)Height_In_1997-Height_In_2011;
do i=1 to dim(Weight);
if Weight(i) &amp;gt;0 and Height(i) &amp;gt;0 then BMI=((Weight(i)*703)/((Height(i))**2),i);
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I cannot get the BMI to calculate for each value of weight and height, but can get it to work for only one.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 19:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511128#M2117</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-07T19:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511133#M2118</link>
      <description>&lt;P&gt;Add a third array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array b(*) bmi1997-bmi2011;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and I(index) is anyway the same when you run the loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so basically you have 15 elements in each array and the index variable I increments from 1 to 15 in the loop and array reference uses the index accordingly&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 19:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511133#M2118</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-07T19:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511135#M2119</link>
      <description>Thank you Paige!&lt;BR /&gt;&lt;BR /&gt;I am going to pull out the year and then do the arrays because it will be much simpler!</description>
      <pubDate>Wed, 07 Nov 2018 19:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511135#M2119</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-07T19:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511169#M2126</link>
      <description>&lt;P&gt;Another follow up question since you seem to be rather good with arrays.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to just as Paige suggested and pull out the year with an array rather than plug and chug. I have nothing against the long way, but I am always looking for the quickest route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you do that? I have something like this as of now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data BMI3;
Set BMI2;
array Weight(*)Weight_1997-Weight_2011;
array Height(*)Height_In_1997-Height_In_2011;
array BMI(*) BMI_1997-BMI_2011;
do Year=1 to dim(Weight);
Year = substr(BMI,5,4);
Weight = Weight[Year];
Height = Height[Year];
BMI = BMI[Year];
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But i am getting illegal reference errors.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 19:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511169#M2126</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-07T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511218#M2135</link>
      <description>&lt;P&gt;Would help me test on my machine, if you could help me/us by providing sample data of what you have and your required output.&lt;/P&gt;
&lt;P&gt;Otherwise, I am gonna just assume what your data may contain and we would keep going back and forth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you could provide us a good representative sample of what you have and the required output, I will give you the solution in one shot. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS Please do not hesitate ever if you need any help in SAS, somebody will offer the solution regardless of complexity. The SAS family here(you, me and all of us) are part of amazing group.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 22:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511218#M2135</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-07T22:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511370#M2156</link>
      <description>&lt;P&gt;I have a set that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Height_In_1997 Weight_1997 Gender DOB_M DOB_Y Race Height_In_1998 Weight_1998 Height_In_1999 Weight-1999 ... BMI_1997 BMI_1998&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 60 150 2 2 1980 2 61 155 ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did it the long way like Paige suggested so that&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data BMI_Year;
	Set BMI2;
	Year = 1997;
	Height = Height_In_1997;
	Weight = Weight_1997;
	BMI = BMI_1997;
	output;
	Year = 1998;
	Height = Height_In_1998;
	Weight = Weight_1998;
	BMI = BMI_1998;
	output;
	Year = 1999;
	Height = Height_In_1999;
	Weight = Weight_1999;
	BMI = BMI_1999;
	output;
	Year = 2000;
	Height = Height_In_2000;
	Weight = Weight_2000;
	BMI = BMI_2000;
	output;
	Year = 2001;
	Height = Height_In_2001;
	Weight = Weight_2001;
	BMI = BMI_2001;
	output;
	Year = 2002;
	Height = Height_In_2002;
	Weight = Weight_2002;
	BMI = BMI_2002;
	output;
	Year = 2003;
	Height = Height_In_2003;
	Weight = Weight_2003;
	BMI = BMI_2003;
	output;
	Year = 2004;
	Height = Height_In_2004;
	Weight = Weight_2004;
	BMI = BMI_2004;
	output;
	Year = 2005;
	Height = Height_In_2005;
	Weight = Weight_2005;
	BMI = BMI_2005;
	output;
	Year = 2006;
	Height = Height_In_2006;
	Weight = Weight_2006;
	BMI = BMI_2006;
	output;
	Year = 2007;
	Height = Height_In_2007;
	Weight = Weight_2007;
	BMI = BMI_2007;
	output;
	Year = 2008;
	Height = Height_In_2008;
	Weight = Weight_2008;
	BMI = BMI_2008;
	output;
	Year = 2009;
	Height = Height_In_2009;
	Weight = Weight_2009;
	BMI = BMI_2009;
	output;
	Year = 2010;
	Height = Height_In_2010;
	Weight = Weight_2010;
	BMI = BMI_2010;
	output;
	Year = 2011;
	Height = Height_In_2011;
	Weight = Weight_2011;
	BMI = BMI_2011;
	output;
	Year = 2013;
	Height = Height_In_2011;
	Weight = Weight_2013;
	if height &amp;gt;0 and weight&amp;gt; 0 then BMI =((Weight_2013*703)/((Height_In_2011)**2));
	output;
	Year = 2015;
	Height = Height_In_2011;
	Weight = Weight_2015;
	if height &amp;gt;0 and weight&amp;gt; 0 then BMI =((Weight_2015*703)/((Height_In_2011)**2));
	output;
	Drop BMI_1997-BMI_2011 Height_In_1997-Height_In_2011 Weight_1997-Weight_2015;
	Label Gender = "1= Male, 2=Female"
		DOB_M = "Date of Birth Month"
		DOB_Y = "Date of Birth Year"
		Race = 1= "Black", 2= "Hispanic", 3= "Mixed Race (Non-Hispanic)" 4= "Non-Black / Non-Hispanic"
		Year= "Year the Survey took place"
		Height = "Height in Inches"
		Weight = "Weight in pounds";
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But&amp;nbsp; I was wondering how you would do that same thing in an array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping and being so kind! I can't speak for everyone, but its often humbling having to post on this forum. However, it has helped me learn rather quickly the tips and tricks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Joe&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 13:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511370#M2156</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-08T13:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511400#M2161</link>
      <description>&lt;P&gt;The sequence seem to jump from 2011 to 2013 and then 2015. in the below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;output;
	Year = 2011;
	Height = Height_In_2011;
	Weight = Weight_2011;
	BMI = BMI_2011;
	output;
	Year = 2013;
	Height = Height_In_2011;
	Weight = Weight_2013;
	if height &amp;gt;0 and weight&amp;gt; 0 then BMI =((Weight_2013*703)/((Height_In_2011)**2));
	output;
	Year = 2015;
	Height = Height_In_2011;
	Weight = Weight_2015;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are you sure or is that a typo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if it is sequential from 1997-2013. it;s easy like&lt;/P&gt;
&lt;P&gt;do year =1997 to 2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 15:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511400#M2161</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-08T15:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511427#M2165</link>
      <description>&lt;P&gt;It did in fact jump. This is a public data set but they have no data for years 2012 and 2014. They also only have weight for 2013 and 2015. Thus, I made an assumption the height would be the same after those years. Long story short, it is correct!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it really as simple as that?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Year = 1997-2015;
	Height = Height_In_1997-Height_In_2015;
	Weight = Weight_1997-Weight_2015;
	BMI = BMI_1997-BMI_2015;
	output;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or should i just go to 2011 and manually do the 2013 and 2015?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 16:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511427#M2165</guid>
      <dc:creator>joebacon</dc:creator>
      <dc:date>2018-11-08T16:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing Variables by Year/ Maybe an array question?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511432#M2168</link>
      <description>&lt;P&gt;Is it really as simple as that?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;Year&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1997&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-2015&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	Height &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Height_In_1997&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;Height_In_2015&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;Weight&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Weight_1997&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;Weight_2015&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	BMI &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; BMI_1997&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;BMI_2015&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	output&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No, let me review and make some adjustments to the array and loop and respond back&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 16:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Grabbing-Variables-by-Year-Maybe-an-array-question/m-p/511432#M2168</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-08T16:24:04Z</dc:date>
    </item>
  </channel>
</rss>

