<?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: What's wrong with my macro program and how to fix it? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28730#M5314</link>
    <description>Please use &lt;BR /&gt;
[pre]&lt;BR /&gt;
options mprint mlogic;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
to check the error in the log.&lt;BR /&gt;
&lt;BR /&gt;
post the log.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In addition, "where time1.i = &amp;amp;filename1.i and dscode ^= "   looks like maybe "&amp;amp;filename1..i "&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Fri, 28 May 2010 15:06:36 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2010-05-28T15:06:36Z</dc:date>
    <item>
      <title>What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28729#M5313</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am a SAS newbie. I wrote this macro, but it doesn't work. I guess it goes wrong when reaching the 4th program, but I still can't figure out how to fix it. Can you please help? Thanks a lot...&lt;BR /&gt;
&lt;BR /&gt;
%macro clean_rawfiles(importfile=, filelocation=, filename=, varnum=);&lt;BR /&gt;
proc import	datafile="C:\ARC DS Downloading (HoangLuong)\DataFiles\&amp;amp;importfile..csv"&lt;BR /&gt;
					out=&amp;amp;filelocation..&amp;amp;filename&lt;BR /&gt;
					replace;&lt;BR /&gt;
					getnames=no;&lt;BR /&gt;
run;&lt;BR /&gt;
data time &amp;amp;filename;&lt;BR /&gt;
	set &amp;amp;filelocation..&amp;amp;filename;&lt;BR /&gt;
	if var1="Code" then output time;&lt;BR /&gt;
	else output &amp;amp;filename;&lt;BR /&gt;
run;&lt;BR /&gt;
data time1 (drop=var2-var&amp;amp;varnum);&lt;BR /&gt;
	set time (drop=var1);&lt;BR /&gt;
	array x&lt;LI&gt; var2 - var&amp;amp;varnum;&lt;BR /&gt;
	do i = 1 to dim(x);&lt;BR /&gt;
		time = x&lt;I&gt;;&lt;BR /&gt;
		output;&lt;BR /&gt;
	end;&lt;BR /&gt;
run;&lt;BR /&gt;
data &amp;amp;filename1 (drop=var2-var&amp;amp;varnum); /*I guess it goes WRONG from here*/&lt;BR /&gt;
	set &amp;amp;filename (rename=(var1=dscode));&lt;BR /&gt;
	array x&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;&lt;I&gt; var2 - var&amp;amp;varnum;&lt;BR /&gt;
	do i = 1 to dim(x);&lt;BR /&gt;
		&amp;amp;filename = x&lt;I&gt;;&lt;BR /&gt;
		output;&lt;BR /&gt;
	end;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	drop table &amp;amp;filelocation..&amp;amp;filename;&lt;BR /&gt;
quit;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	create table &amp;amp;filelocation..&amp;amp;filename as&lt;BR /&gt;
		select dscode, time as year, &amp;amp;filename&lt;BR /&gt;
		from time1, &amp;amp;filename1&lt;BR /&gt;
		where time1.i = &amp;amp;filename1.i and dscode ^= ""&lt;BR /&gt;
		order by dscode, time;&lt;BR /&gt;
quit;&lt;BR /&gt;
%mend clean_rawfiles;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: hoangluong

Message was edited by: hoangluong&lt;/I&gt;&lt;/I&gt;&lt;/LI&gt;</description>
      <pubDate>Fri, 28 May 2010 11:53:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28729#M5313</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-28T11:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28730#M5314</link>
      <description>Please use &lt;BR /&gt;
[pre]&lt;BR /&gt;
options mprint mlogic;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
to check the error in the log.&lt;BR /&gt;
&lt;BR /&gt;
post the log.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In addition, "where time1.i = &amp;amp;filename1.i and dscode ^= "   looks like maybe "&amp;amp;filename1..i "&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 28 May 2010 15:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28730#M5314</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-05-28T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28731#M5315</link>
      <description>Hi:&lt;BR /&gt;
  There is so much unknown about your macro program. Turning on these options:&lt;BR /&gt;
&lt;B&gt;options mprint mlogic symbolgen;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
will help you debug what's happening. However, what I find very helpful in situations like this is for you to tell us, in narrative form, what you think is happening or what you WANT to have happen. For example:&lt;BR /&gt;
&lt;BR /&gt;
1) The PROC IMPORT step is reading in a CSV file identified by &amp;amp;IMPORTFILE and is writing out a SAS dataset identified by &amp;amp;FILELOCATION (the library) and &amp;amp;FILENAME (the dataset).&lt;BR /&gt;
&lt;BR /&gt;
2) The Data step program that starts:&lt;BR /&gt;
&lt;B&gt; DATA time &amp;amp;filename;&lt;/B&gt; is creating 2 SAS datasets from the SAS dataset created above. I know that if VAR1="Code", then I have ????????? and so I need that information in the TIME dataset. All the rest of the observations go into the WORK.&amp;amp;FILENAME dataset. The variables that I have read in from the CSV file are:&lt;BR /&gt;
VAR1 - VAR&amp;amp;VARNUM (I need to supply &amp;amp;VARNUM in the macro program because ????????)&lt;BR /&gt;
The TIME dataset only needs ??????;&lt;BR /&gt;
The WORK.&amp;amp;FILENAME dataset needs ??????&lt;BR /&gt;
&lt;BR /&gt;
3) The dataset that starts &lt;B&gt;DATA time1;&lt;/B&gt; is using the ?????? dataset as input. I have an ARRAY statement and a DO loop because ??????????. I am setting the TIME variable equal to X (the array name ????) instead of &lt;BR /&gt;
&lt;B&gt;time = x(i);&lt;/B&gt; because ???????? Then in my output statement, I am doing an OUTPUT for each iteration through the DO loop. This means that my data will come into the program like this:&lt;BR /&gt;
***** show what your variables are coming in *****&lt;BR /&gt;
and after the program is over, then WORK.TIME1 will look like this:&lt;BR /&gt;
**** show what you WANT your variables to look like coming out of the program&lt;BR /&gt;
&lt;BR /&gt;
4) Then I create DATA WORK.&amp;amp;FILENAME1 from WORK.&amp;amp;FILENAME. Since I do not ever PASS a value for &amp;amp;FILENAME1, I expect that the value for &amp;amp;FILENAME1 will come from ??????.  I have a DO loop in this program. In the DO loop, I have the statement:&lt;BR /&gt;
&lt;B&gt;&amp;amp;filename=x;&lt;/B&gt;&lt;BR /&gt;
  &lt;BR /&gt;
Again, since X is the name of the ENTIRE array, what I think is going to happen here is ??????????. &lt;BR /&gt;
&lt;BR /&gt;
5) Then, I have a PROC SQL step to drop the dataset that I created in the PROC IMPORT step. I do this because ????????.&lt;BR /&gt;
&lt;BR /&gt;
6) Last, I have another PROC SQL step where I create &amp;amp;FILELOCATION..&amp;amp;FILENAME from my 2 datasets: WORK.TIME1 and &amp;amp;FILENAME1 (which I think I created in step 4) I think that I can use I (generally a DO loop index) here in the SQL step. However, the SQL step is NOT inside a Macro %DO loop, so I am using this syntax because I want ?????????. In this processing, I envision joining the cleaned up TIME and &amp;amp;FILENAME datasets together based on the WHERE condition:&lt;BR /&gt;
&lt;B&gt;where time1.i = &amp;amp;filename1.i and dscode ^= ""&lt;/B&gt;&lt;BR /&gt;
  &lt;BR /&gt;
In this program, I think the value of the variable I is going to be: ??????? and I want this PROC SQL step to execute ????? times based on ???????.&lt;BR /&gt;
&lt;BR /&gt;
Sometimes, it is useful to have a verbal description of what your whole process is. It's also useful to see a little bit of the data. In addition, these papers are very good papers which explain some of the basics of Macro processing and SAS Array processing. &lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/papers/sgf07/arrays1780.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sgf07/arrays1780.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi29/070-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/070-29.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
There is a HUGE difference between a Macro %DO loop and a regular DATA step DO loop and I'm not convinced that you are using the DATA step DO loop in the correct way in your program. Nor am I really sure just WHAT it is your program is trying to do. That's where having some information explaining the process would be useful.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 28 May 2010 16:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28731#M5315</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-28T16:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28732#M5316</link>
      <description>Hi, thanks so much for the help/suggestions. I've fixed the program and now it's running without errors. &lt;BR /&gt;
&lt;BR /&gt;
The errors occurred because I didn't put the period (.) between &amp;amp;filename and 1, i.e. should be &amp;amp;filename.1 rather than &amp;amp;filename1. Why so? I can't figure out. I just think &amp;amp;filename resolves to DY (see my testing with file DY), and 1 is a number I want attached to DY so I'll have DY1. &lt;BR /&gt;
&lt;BR /&gt;
I have a time series dataset, with 100,000 firms and each having 13 years of data. When I download the data from the database, the data is arranged like this:&lt;BR /&gt;
&lt;BR /&gt;
Firm   1997 1998 .... 2010&lt;BR /&gt;
firm1    xxx  xxx  ....  xxx&lt;BR /&gt;
firm2    yyy yyy  ....  yyy&lt;BR /&gt;
and so on.&lt;BR /&gt;
&lt;BR /&gt;
Now I want to restructure the data so that I have the correct PANEL DATA structure, that is, &lt;BR /&gt;
&lt;BR /&gt;
Firm   Year VariableOfInterest&lt;BR /&gt;
firm1   1997    xxxx&lt;BR /&gt;
firm1   1998    yyyy&lt;BR /&gt;
....&lt;BR /&gt;
firm1   2010    zzgg&lt;BR /&gt;
&lt;BR /&gt;
firm2  1997    zxxx&lt;BR /&gt;
firm2  1998    gagag&lt;BR /&gt;
&lt;BR /&gt;
and so on.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks so much for the quick reply and for the very useful tutorials (esp. "Array: Construction and Usage...."...</description>
      <pubDate>Sat, 29 May 2010 05:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28732#M5316</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-29T05:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28733#M5317</link>
      <description>the compiler allows you to have macro variables named like filename1 as well as file and filename. So how do you think it should tell the difference and which is referenced by &amp;amp;filename1 &lt;BR /&gt;
??</description>
      <pubDate>Sat, 29 May 2010 12:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28733#M5317</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-05-29T12:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28734#M5318</link>
      <description>Hi:&lt;BR /&gt;
  This is where a description and seeing the data might be useful. Given the structure that you outline, I'm not sure I understand what your macro program is actually doing. From your description, the problem sounds like a more simple transpose problem. If all you want to do is take a structure like this (showing data only...no headers)&lt;BR /&gt;
[pre]&lt;BR /&gt;
firm1     1101     1102     1103     1104     1105     1106     1107     1108     1109     1110     1111     1112     1113&lt;BR /&gt;
firm2     2201     2202     2203     2204     2205     2206     2207     2208     2209     2210     2211     2212     2213&lt;BR /&gt;
firm3     3301     3302     3303     3304     3305     3306     3307     3308     3309     3310     3311     3312     3313&lt;BR /&gt;
firm4     4401     4402     4403     4404     4405     4406     4407     4408     4409     4410     4411     4412     4413&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
And turn it into a structure like this (only 2 firms shown):&lt;BR /&gt;
[pre]&lt;BR /&gt;
     firm1     1998     1101&lt;BR /&gt;
     firm1     1999     1102&lt;BR /&gt;
     firm1     2000     1103&lt;BR /&gt;
     firm1     2001     1104&lt;BR /&gt;
     firm1     2002     1105&lt;BR /&gt;
     firm1     2003     1106&lt;BR /&gt;
     firm1     2004     1107&lt;BR /&gt;
     firm1     2005     1108&lt;BR /&gt;
     firm1     2006     1109&lt;BR /&gt;
     firm1     2007     1110&lt;BR /&gt;
     firm1     2008     1111&lt;BR /&gt;
     firm1     2009     1112&lt;BR /&gt;
     firm1     2010     1113&lt;BR /&gt;
     firm2     1998     2201&lt;BR /&gt;
     firm2     1999     2202&lt;BR /&gt;
     firm2     2000     2203&lt;BR /&gt;
     firm2     2001     2204&lt;BR /&gt;
     firm2     2002     2205&lt;BR /&gt;
     firm2     2003     2206&lt;BR /&gt;
     firm2     2004     2207&lt;BR /&gt;
     firm2     2005     2208&lt;BR /&gt;
     firm2     2006     2209&lt;BR /&gt;
     firm2     2007     2210&lt;BR /&gt;
     firm2     2008     2211&lt;BR /&gt;
     firm2     2009     2212&lt;BR /&gt;
     firm2     2010     2213&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                         &lt;BR /&gt;
Then there are a couple of things to know. First, SAS variable names can't start with a number. So your dataset variables have to be something other than 1998, 1999. In my program below, where I read in the "original" structure, I call the variable y1998, y1999, etc&lt;BR /&gt;
 &lt;BR /&gt;
[pre]&lt;BR /&gt;
data orig_data;&lt;BR /&gt;
  length firm $8;&lt;BR /&gt;
  infile datalines dsd dlm=',';&lt;BR /&gt;
  input firm y1998 y1999 y2000 y2001 y2002 y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
"firm1",1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113&lt;BR /&gt;
"firm2",2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213&lt;BR /&gt;
"firm3",3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313&lt;BR /&gt;
"firm4",4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                        &lt;BR /&gt;
proc print data=orig_data noobs;&lt;BR /&gt;
  title 'Original Data';&lt;BR /&gt;
run;&lt;BR /&gt;
            &lt;BR /&gt;
proc sort data=orig_data;&lt;BR /&gt;
  by firm ;&lt;BR /&gt;
run;&lt;BR /&gt;
                  &lt;BR /&gt;
proc transpose data=orig_data out=panelout;&lt;BR /&gt;
  by firm ;&lt;BR /&gt;
run;&lt;BR /&gt;
           &lt;BR /&gt;
proc print data=panelout;&lt;BR /&gt;
  title 'After Transpose';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
  After the transpose step, the (partial) transposed data looks like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
After Transpose&lt;BR /&gt;
&lt;BR /&gt;
Obs    firm     _NAME_    COL1&lt;BR /&gt;
&lt;BR /&gt;
  1    firm1    y1998     1101&lt;BR /&gt;
  2    firm1    y1999     1102&lt;BR /&gt;
  3    firm1    y2000     1103&lt;BR /&gt;
  4    firm1    y2001     1104&lt;BR /&gt;
  5    firm1    y2002     1105&lt;BR /&gt;
  6    firm1    y2003     1106&lt;BR /&gt;
  7    firm1    y2004     1107&lt;BR /&gt;
  8    firm1    y2005     1108&lt;BR /&gt;
  9    firm1    y2006     1109&lt;BR /&gt;
 10    firm1    y2007     1110&lt;BR /&gt;
 11    firm1    y2008     1111&lt;BR /&gt;
 12    firm1    y2009     1112&lt;BR /&gt;
 13    firm1    y2010     1113&lt;BR /&gt;
 14    firm2    y1998     2201&lt;BR /&gt;
 15    firm2    y1999     2202&lt;BR /&gt;
 16    firm2    y2000     2203&lt;BR /&gt;
 17    firm2    y2001     2204&lt;BR /&gt;
 18    firm2    y2002     2205&lt;BR /&gt;
 19    firm2    y2003     2206&lt;BR /&gt;
 20    firm2    y2004     2207&lt;BR /&gt;
 21    firm2    y2005     2208&lt;BR /&gt;
 22    firm2    y2006     2209&lt;BR /&gt;
 23    firm2    y2007     2210&lt;BR /&gt;
 24    firm2    y2008     2211&lt;BR /&gt;
 25    firm2    y2009     2212&lt;BR /&gt;
 26    firm2    y2010     2213&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                 &lt;BR /&gt;
So from this we see that _NAME_ now holds the former variable for year and the COL1 variable holds the value for that year.&lt;BR /&gt;
 &lt;BR /&gt;
Now, all that remains is to actually make a numeric YEAR variable:&lt;BR /&gt;
[pre]&lt;BR /&gt;
                       &lt;BR /&gt;
data final_panel(keep=firm year COL1);&lt;BR /&gt;
  length year 8;&lt;BR /&gt;
  set panelout;&lt;BR /&gt;
  ** get rid of 'y' in from _name_ variable to make year;&lt;BR /&gt;
  year = input(compress(_name_,'y'),4.);&lt;BR /&gt;
run;&lt;BR /&gt;
              &lt;BR /&gt;
proc print data=final_panel noobs;&lt;BR /&gt;
  title 'After Make YEAR Variable';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
        &lt;BR /&gt;
Which would result in (only partial observations shown):&lt;BR /&gt;
[pre]&lt;BR /&gt;
     firm      year     COL1&lt;BR /&gt;
     firm1     1998     1101&lt;BR /&gt;
     firm1     1999     1102&lt;BR /&gt;
     firm1     2000     1103&lt;BR /&gt;
     firm1     2001     1104&lt;BR /&gt;
     firm1     2002     1105&lt;BR /&gt;
     firm1     2003     1106&lt;BR /&gt;
     firm1     2004     1107&lt;BR /&gt;
     firm1     2005     1108&lt;BR /&gt;
     firm1     2006     1109&lt;BR /&gt;
     firm1     2007     1110&lt;BR /&gt;
     firm1     2008     1111&lt;BR /&gt;
     firm1     2009     1112&lt;BR /&gt;
     firm1     2010     1113&lt;BR /&gt;
     firm2     1998     2201&lt;BR /&gt;
     firm2     1999     2202&lt;BR /&gt;
     firm2     2000     2203&lt;BR /&gt;
     firm2     2001     2204&lt;BR /&gt;
     firm2     2002     2205&lt;BR /&gt;
     firm2     2003     2206&lt;BR /&gt;
     firm2     2004     2207&lt;BR /&gt;
     firm2     2005     2208&lt;BR /&gt;
     firm2     2006     2209&lt;BR /&gt;
     firm2     2007     2210&lt;BR /&gt;
     firm2     2008     2211&lt;BR /&gt;
     firm2     2009     2212&lt;BR /&gt;
     firm2     2010     2213&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                          &lt;BR /&gt;
If you wanted to rename COL1, at this point, you could use the RENAME= option in the last data set. If you do NOT already have a SAS dataset in the original structure and you need to read a dataset from some form -into- a SAS dataset, then you could also do the transpose/transform/output of one year per observation in the initial read program. But I didn't do that because you said your dataset was already in the original form.&lt;BR /&gt;
 &lt;BR /&gt;
When you are working with time series data, you frequently must transpose the entire dataset or subset in order to work with the data in your procedure of choice. There is a good section in the documentation entitled "Working with Time Series Data" that may prove very informative:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63348/HTML/default/viewer.htm#/documentation/cdl/en/etsug/63348/HTML/default/tsdata_toc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/etsug/63348/HTML/default/viewer.htm#/documentation/cdl/en/etsug/63348/HTML/default/tsdata_toc.htm&lt;/A&gt;&lt;BR /&gt;
            &lt;BR /&gt;
cynthia</description>
      <pubDate>Sat, 29 May 2010 22:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28734#M5318</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-29T22:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with my macro program and how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28735#M5319</link>
      <description>Thanks so much, Cynthia! Actually, I have tried PROC TRANSPOSE before switching to the use of arrays. The Proc Transpose takes like hours and hours on my PC and I can't figure out why, whereas the array does a much better job. Thanks a lot for suggesting the Proc Means, which I hadn't known until now :-). Thanks a lot</description>
      <pubDate>Thu, 17 Jun 2010 05:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-s-wrong-with-my-macro-program-and-how-to-fix-it/m-p/28735#M5319</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-17T05:07:30Z</dc:date>
    </item>
  </channel>
</rss>

