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.
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;
Hi Mark,
Thanks for your help, You are a savior i got it right.
Thanks.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.