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
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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