BookmarkSubscribeRSS Feed
Ragesh
Fluorite | Level 6


Hi All,

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

data test1;

set test2;

keep col1 col2 Wk_:;

run;

This works fine in SAS 9.1.3 but it throws error in SAS 9.3

Could anyone suggest an alternative for this.

6 REPLIES 6
data_null__
Jade | Level 19

The syntax looks correct.  What is the error?

Ragesh
Fluorite | Level 6

The variables are not getting resolved in SAS 9.3

It is getting resolved in SAS 9.1.3.

esjackso
Quartz | Level 8

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.

EJ

data_null__
Jade | Level 19

But you didn't show the error message.  "not getting resolved" is not an error message.

Cynthia_sas
Diamond | Level 26

Hi:

  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.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2238 views
  • 0 likes
  • 5 in conversation