I have two datasets for Feb and March 2016 with same varaibles. I need to bring in values from four vairables in feb dataset to march. without changing other March data. Can you please help.
Can i join the tables?
for example..
Please post sample data and expected output. We can make guesses but it's easier if you detail your problem as much as possible.
Feb data
Conditional_Format_BD | Conditional_Format_EP | Conditional_Format_CR | Conditional_Format_IN |
0 | 0 | 0 | 0 |
0 | 1 | 0 | 0 |
0 | 0 | 0 | 0 |
March data
Conditional_Format_BD | Conditional_Format_EP | Conditional_Format_CR | Conditional_Format_IN | |
0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 |
These are the values i need to bring in from previous month.. Other values in march should not be changed ( I mean other varaibles which I am not showing here) . I will be creating a macro vaiable for prev and Curr month..
dataset looks like this. I need to copy last four varaible values from Feb to March
Date_Report | DD | SS | EE | XX | Conditional_Format_BD | Conditional_Format_EP | Conditional_Format_CR | Conditional_Format_IN |
29/02/2016 | 11383101.15 | 13105123.62 | 8318579.66 | 2706532.97 | 0 | 0 | 0 | 0 |
29/02/2016 | 1730.8 | 1730.8 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 11386872 | 13110942.78 | 8322104.77 | 2716298.05 | 0 | 1 | 0 | 0 |
29/02/2016 | 11384831.95 | 13110781.22 | 8322104.77 | 2716298.05 | 0 | 1 | 0 | 0 |
29/02/2016 | 5482757.32 | 6377402.86 | 2421942.79 | 278172.26 | 0 | 0 | 0 | 0 |
29/02/2016 | -3639 | -3639 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 5479118.32 | 6374998.997 | 2421942.79 | 279848.8 | 1 | 1 | 0 | 0 |
29/02/2016 | 5478024.32 | 6374996.928 | 2421942.79 | 279848.8 | 0 | 1 | 0 | 0 |
29/02/2016 | 2737152.6 | 3667196.94 | 2871919.48 | -789862.87 | 0 | 0 | 0 | 0 |
29/02/2016 | 90.81 | 90.81 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 2737242.286 | 3669005.514 | 2871919.48 | -789862.87 | 1 | 1 | 0 | 0 |
29/02/2016 | 2737243.41 | 3668931.26 | 2871919.48 | -789862.87 | 0 | 1 | 0 | 0 |
29/02/2016 | 1479461.27 | 2511383.61 | 1250537.37 | 449979.07 | 0 | 0 | 0 | 0 |
29/02/2016 | -2289.72 | -2289.72 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 1477171.61 | 2509374.885 | 1250412.37 | 449979.07 | 1 | 1 | 0 | 0 |
29/02/2016 | 1477171.55 | 2509375 | 1250412.37 | 449979.07 | 0 | 1 | 0 | 0 |
29/02/2016 | 34909728 | 45497720.69 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 34909734 | 45495069.95 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 7394492 | 8251938.9 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 7394419 | 8261482.89 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 14925 | 722945.45 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 14925 | 724995.3723 | 0 | 1 | 0 | 0 | ||
29/02/2016 | 6277864 | 3677231.33 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 6277489 | 3663867.51 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 494216 | 324496.1 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 494846 | 324158.48 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 24583 | 23430.48 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 24583 | 23593.27 | 0 | 1 | 0 | 0 | ||
29/02/2016 | 209964 | 313892.01 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 209964 | 314443.73 | 0 | 1 | 0 | 0 | ||
29/02/2016 | 1736807.67 | -398776.51 | 0 | 0 | 0 | 0 | ||
29/02/2016 | 1632158.83 | -426445.22 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 12882827.23 | 14113074.33 | 10304456.77 | -2532468.36 | 0 | 0 | 0 | 0 |
31/03/2016 | 11101.21 | 11101.21 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 12893926.19 | 14121171.89 | 10324971.84 | -2480644.94 | 0 | 0 | 0 | 0 |
31/03/2016 | 12893928.44 | 14121172.19 | 10324971.84 | -2480644.94 | 0 | 0 | 0 | 0 |
31/03/2016 | 5971097.27 | 6865585.26 | 2719493.66 | 1234459.3 | 0 | 0 | 0 | 0 |
31/03/2016 | -2662.7 | -2662.7 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 5968434.57 | 6858028.355 | 2719493.66 | 1234312 | 0 | 0 | 0 | 0 |
31/03/2016 | 5968434.57 | 6858118.839 | 2719493.66 | 1234312 | 0 | 0 | 0 | 0 |
31/03/2016 | 3644079.83 | 3958831.83 | 3305972.27 | -392962.23 | 0 | 0 | 0 | 0 |
31/03/2016 | 584 | 584 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 3644663.188 | 3960652.543 | 3305913.27 | -392962.23 | 0 | 0 | 0 | 0 |
31/03/2016 | 3644663.83 | 3960573.117 | 3305913.27 | -392962.23 | 0 | 0 | 0 | 0 |
31/03/2016 | 2186415.17 | 2699268.08 | 1447707.98 | -689443.57 | 0 | 0 | 0 | 0 |
31/03/2016 | -2893.54 | -2893.54 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 2183521.533 | 2696806.303 | 1447432.98 | -689443.57 | 0 | 0 | 0 | 0 |
31/03/2016 | 2183521.63 | 2696806.402 | 1447432.98 | -689443.57 | 0 | 0 | 0 | 0 |
31/03/2016 | 41686666 | 48893864.84 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 41687129 | 48893720.46 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 8234240 | 8872781.99 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 8234240 | 8859971.11 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 2484 | 723241.79 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 2548 | 718241.4833 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 12234776 | 4634086.1 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 12233803 | 4611346.67 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 687651 | 390287.17 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 688978 | 390056.16 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 20050 | 24900.19 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 20050 | 25249.07 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 222388 | 334664.78 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 222388 | 333513.58 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 1483721.24 | -33802.8 | 0 | 0 | 0 | 0 | ||
31/03/2016 | 1397097.79 | -74444.09 | 0 | 0 | 0 | 0 |
I'm sorry, I still don't understand what you want to do. Often it helps to post sample data. If you have two datasets (Feb and March) as inputs, and you have a desired output dataset (WANT), I suggest you post all three.
That is, given a dataset FEB and a dataset MARCH as below (show 5-10 records from each), I want to create a dataset WANT as below (show all records and all varaibles that result from combining FEB and MARCH in the way you want).
If you clearly define the sample inputs and output, people should be better able to help.
How do you know which row in your Feb dataset line up with which row in Mar dataset?
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.