How to compare multiple dimension data

Reply
Contributor
Posts: 20

How to compare multiple dimension data

Basically I have these two data files which are Inputfile1 and Inputfile2.


To get to the output  we need to match location, country and school code and date. Underneath each date is the amount of students away on the weekend

to match the certaindate variable in inputfile1 with the dates in Inputfile2,  I need to firstly subtract the dates in InputFile2 by 6 and check if Certain date is less then that.

The dates in Inputfile2 are layed out exactly like the way I have put them they dont have a variable assigned to them

Matching the dates

So to match the date we subtract the date in Inputfile2 by 6 and check if CertainDate is less then that, the dates are layed out they don't have any variables assigned to them

Inputfile2

Country Location  SchoolCode

                                                                      26/07/2009     02/08/2009     09/08/2009     16/08/2009     23/08/2009     30/08/2009     06/09/2009     13/09/2009

America  IL       123456                                      24              45

America  GA       456777                                   44              6

America  TXS      456565                                  25              45

Inputfile1

Country     Location       SchoolCode        CertainDate

America         IL               123456       24/07/2009

America        GA              456777       19/07/2009

Output

Country         Location        SchoolCode     DatesAbsent

America                   IL         123456          45

America                  GA        456777         44

Pls Help cheers

Super User
Posts: 11,343

Re: How to compare multiple dimension data

Posted in reply to johnhuang12

I am a bit confused with your statement "The dates in Inputfile2 are layed out exactly like the way I have put them they dont have a variable assigned to them." If there isn't a variable associated then how do they exist in SAS?

You would probably be better off transforming the data from inputfile2 to have variables County, Location, SchoolCode, ComparisonDate (the column headings), and the values in those columns as DatesAbsent. This is likely easy once the date issue is clarified.


Ask a Question
Discussion stats
  • 1 reply
  • 159 views
  • 0 likes
  • 2 in conversation