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


Hello: I am an SQL professional- brand new to SAS. I need to update just one row in SAS table. The datafield is a date type. I am just trying to update one row, set the field = "01Oct2015" where the id = xyz. The code runs and the value is set to a period. I know this must be a format issue. Could someone please help me?

1 ACCEPTED SOLUTION

Accepted Solutions
stat_sas
Ammonite | Level 13

Try this.

proc sql;

update have

set field='01Oct2015'd

where id='xyz';

quit;

View solution in original post

2 REPLIES 2
Hima
Obsidian | Level 7

data have;
input id date;
format date mmddyy10.;
informat date mmddyy10.;
cards;
1 10/25/2015
2 10/15/2015
3 10/10/2015
;
run;

data want;
set have;
if id ne 1 then date_new=put(date,mmddyy10.);
else date_new=put(date,date9.);
run;

proc print; run;

stat_sas
Ammonite | Level 13

Try this.

proc sql;

update have

set field='01Oct2015'd

where id='xyz';

quit;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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