BookmarkSubscribeRSS Feed
StefB
Calcite | Level 5

Hi all,

I am VERY new to SAS and my question may come off as ignorant, but is there a reason why every time I run my code it keeps replacing the last column.  For instance, I needed to do the Year of Birth and once I ran it, it replaced the column of my last code I ran, but none of my raw data is replaced its just the code I write for.  I hope this makes sense.  Thank you!

-Stef

3 REPLIES 3
art297
Opal | Level 21

Post the code you ran and an example (in the form of a data step) of your data.

 

Art, CEO, AnalystFinder.com

 

Astounding
PROC Star

As @art297 mentioned, we're missing a lot of the specifics here.  Here's the general answer.

 

You might be looking at expected behavior of the software.  For example, consider these types of programs:

 

data new;

set old;

** statements to make changes to the data;

run;

 

data new;

infile 'some source of text data';

input some list of variables;

** statements to make changes to the data;

run;

 

In both cases, the changes apply to the data set being created only (named NEW in both examples).  None of the changes are expected to appear in the incoming source of data.

PeterClemmensen
Tourmaline | Level 20

What does your data and code look like?

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
  • 3 replies
  • 327 views
  • 0 likes
  • 4 in conversation