BookmarkSubscribeRSS Feed
ahuja
Fluorite | Level 6

Hi,

On running format command i am getting an error "

ERROR: You are trying to use the numeric format AGE_FMT with the character variable Age in data

  set CDRIVE.BANK_DATA2."

Below is the code i am trying to execute:

title 'Decision by Age';

proc freq data=&hmda_file order=freq;

format age age_fmt. action status_fmt.;  table age * action / missing nocum nopercent nocol; run;

Kindly help.!

Thanks in advance.

2 REPLIES 2
Steelers_In_DC
Barite | Level 11

You provide the answer in your question.

You are using a numeric format (age_fmt.) for a character variable (age).

You can either remove age age_fmt. from the format command or before this step change the character age to numeric age.

data have;

infile cards dsd;

input age $;

cards;

8

;

run;

data want(rename=(age_2=age));

set have;

age_2 = input(age,8.);

drop age;

run;

ahuja
Fluorite | Level 6

Hi Mark,

Thanks for your help, You are a savior i got it right.

Thanks.

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
  • 848 views
  • 0 likes
  • 2 in conversation