Hi All,
I want to update existing format.
i tried
proc format library = work.formats
cntlout = cntlout;
run;
Now i want to update value for the existing format.
Format name :- FMT1
Old Value - ' OLDNAME' to New Value - ' NEWNAME'
so next time it should pickup NEWNAME so how to update existing format FMT1 Value ?
Please advise.
Thank you,
Sanket
@Sanket wrote:
Hi All,
I want to update existing format.
i tried
proc format library = work.formats
cntlout = cntlout;
run;
Now i want to update value for the existing format.
Format name :- FMT1
Old Value - ' OLDNAME' to New Value - ' NEWNAME'
so next time it should pickup NEWNAME so how to update existing format FMT1 Value ?
Please advise.
Thank you,
Sanket
You created a new dataset that describes all the formats in WORK when you ran
proc format library = work.formats cntlout = cntlout;
run;
Now you can look in that dataset (WORK.CNTLOUT) and replace the value you want to have replaced.
After that, use the dataset as input for proc format:
proc format library = work.formats cntlin = cntlout;
run;
Post test datas in the form of a datastep if you want exact answers. This is just the theory - use cntlout to get a dataset as you have done, updated that dataset as you want, then cntlin in proc format to read the dataset back in.
@Sanket wrote:
Hi All,
I want to update existing format.
i tried
proc format library = work.formats
cntlout = cntlout;
run;
Now i want to update value for the existing format.
Format name :- FMT1
Old Value - ' OLDNAME' to New Value - ' NEWNAME'
so next time it should pickup NEWNAME so how to update existing format FMT1 Value ?
Please advise.
Thank you,
Sanket
You created a new dataset that describes all the formats in WORK when you ran
proc format library = work.formats cntlout = cntlout;
run;
Now you can look in that dataset (WORK.CNTLOUT) and replace the value you want to have replaced.
After that, use the dataset as input for proc format:
proc format library = work.formats cntlin = cntlout;
run;
Use the "little running man" icon in the top of your "Post" or "Reply" window to post SAS code. This preserves the formatting and even gives you enhanced-editor-like coloring:
proc format;
value $id
'1'='Mary'
'2'='Tom'
'3'='Joe'
;
run;
options fmtsearch=(work);
proc format fmtlib library=work.formats;
select $id;
run;
quit; * not necessary;
proc format library = work.formats cntlout = cntlout;
select $id;
run;
proc sql;
update cntlout
set LABEL='Kim'
where label='Joe';
quit;
proc format library = work.formats cntlin = cntlout;
select $id;
run;
proc format library = work.formats cntlout = cntlout;
select $id;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.