BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jackblack
Calcite | Level 5

Thank you all for your help.  I don't want to say why it was set up in that way but have to read the data. 

 

Ksharp, if I understand your code correctly it will rename all variables from all datasets in WORK.  Can you show me the results? 

 

We have 3 years datasets monthly and I may need some of them so I am not sure your first.memname and last.memname will work from the data storage folder.

 

I remembered I did a similar job before but I don't have the code anymore because of changing jobs.  I think basically we need prco contents to create and output a file that has a statement of rename then using %include in next data steps.

 

Shmuel
Garnet | Level 18

Renaming all variables by compressing 0-9 digits from their names, needs a check: 

are there variable names where the digits are not the suffix of yymm format (like 1601) !

If there are such variables, the code should check for suffix being in a given period (like 1601 - 1612).

jackblack
Calcite | Level 5

I am sure there are more than one way to do this job but I tried Shmuel's code and it works for me.  Thank you all again.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 17 replies
  • 5997 views
  • 2 likes
  • 5 in conversation