11-21-2013 01:52 AM
In our project we have a variable starting with Wk_1 to Wk_100.
We have to represent it in a single variable in a data step. we have to read all the variables that starts with Wk
Our code goes like this
keep col1 col2 Wk_:;
This works fine in SAS 9.1.3 but it throws error in SAS 9.3
Could anyone suggest an alternative for this.
11-21-2013 05:54 AM
Example 3 in this paper may help you to find your answer : Use the Full Power of SAS® in Your Function-Style Macros
11-21-2013 08:21 AM
Thats interesting I would have thought it was the other way around ... I thought the colon abbreviation is relative new addition to the code base like in version 9.2.
I use the colon shortcut all the time in 9.3.
11-21-2013 09:05 AM
If you have something that works in one version of SAS, but not in another version of SAS, your best resource is to open a track with Tech Support. The doc for SAS 9.3 references name prefix lists as being valid SAS(R) 9.3 Language Reference: Concepts, Second Edition and so, Tech Support has both versions (9.1.3 and 9.3) in which to test your code.
To open a track with Tech Support, you can go to support.sas.com and click on the link for "Submit a Problem" on the left hand navigation pane.