Hi:
Just to clarify...there is a difference between MERGING datasets and CONCATENATING or APPENDING datasets.
Here's an example....you have a dataset for every month: WORK.JAN, WORK.FEB, WORK.MAR, etc and the data looks like this:
[pre]
file WORK.JAN
day sale month
01 101 01
02 102 01
03 103 01
file WORK.FEB
day sale month
01 201 02
02 202 02
03 203 02
file WORK.MAR
day sale month
01 301 03
02 302 03
03 303 03
[/pre]
and you want to "stack" or "append" all the files together so that you have an entire year. That syntax would be:
[pre]
data allyear;
set work.jan work.feb work.mar work.apr work.may work.jun
work.jul work.aug work.sep work.oct work.nov work.dec;
run;
[/pre]
(or you could use PROC APPEND or PROC SQL,) but for now, let's stick with a data step program. The output in WORK.ALLYEAR would now look like this (only a few obs shown for each month):
[pre]
file WORK.ALLYEAR
day sale month
01 101 01
02 102 01
03 103 01
01 201 02
02 202 02
03 203 02
01 301 03
02 302 03
03 303 03
[/pre]
Note how the data are "stacked" one month on top of the next month and so on. This would be concatenating or appending.
Or, you could join the data "horizontally". Consider this data for every month (only a few obs are shown) the day variable identifies the day of the month the sale variable for each month, for ease of the example, is named jansale, febsale, marsale, etc:
[pre]
file WORK.JAN
day jansale
01 101
02 102
03 103
file WORK.FEB
day febsale
01 201
02 202
03 203
file WORK.MAR
day marsale
01 301
02 302
03 303
[/pre]
If the data were joined horizontally, you would get this:
[pre]
file WORK.ALLYEAR
day jansale febsale marsale
01 101 201 301
02 102 202 302
03 103 203 303
.... more observations ....
25 125 225 325
26 126 226 326
27 127 227 327
28 128 228 328
29 129 . 329
30 130 . 330
31 131 . 331
[/pre]
Note how the end of the month shows missing values for days 29, 30 and 31 for Feb (because Feb did not have any sales on those days).
The code that created the above output is shown below:
[pre]
data allyear;
merge jan(in=injan)
feb(in=infeb)
mar(in=inmar);
by day;
run;
proc print data=allyear;
title 'after merge';
run;
[/pre]
If you are appending, then not having Tuesday in one file should not make a difference. If you are merging, using a data step, then you should merge with a BY statement and if you are joining with PROC SQL, then you have to be careful with the type of join you code so you get the right combination of rows and columns in the output file.
cynthia