turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-13-2013 10:43 AM

Hi,

I've put the same post unter data step and macro section as well. But since the outcome should be a matrix, I will just try to look for suggestions here as well. So far I've only got a bit experience with data step, sql and macros and not at all with IML. So I dont really know if this is the right place to put my quesiton.

The situation is:

I want to compare the values of 2 groups of variables in the same data set "work.have". I've saved the two groups of variables in two macro variables &gIS and &gSHOULD with proc sql. Each group has 40 variables and each variable has 60 observations (persons). The data was sorted, so the counterparty of the 1st variable in gIS is just the 1st variable in gSHOULD and so on. The aim is to do a plausibility check. If the data was right, then the values of the variables in gIS should be bigger than the ones in gSHOULD.

What i want to get is a dataset with 61 rows and 41 columns that looks like this:

Header 1 | Comparison Var1 from gIS with Var1 from gSHOULD | Comparison Var2 from gIS with Var2 from gSHOULD | Comparison Var3 from gIS with Var3 from gSHOULD |
---|---|---|---|

Person 1 | 0 | 0 | 0 |

Person 2 | 1 | 0 | 0 |

Person 3 | 0 | 1 | 0 |

The headers are a bit awkward. I think i have to name them another way. but the aim is to have a '0', where the condition gIS>gSHOULD got satisfied and 1 otherwise. So the '1' is like a warning, that sth. is wrong with the data there.

I've only worked with vectors before and since the outcoming is actually a matix, I dont know how to write my script.

I hope I made my task clear. Any help is very much appreciated!!

BR Dingdang