Hi all,
I am facing this issue. Please help me with the error. I have a dataset named continent with 2 variables-continentid and continent name. I want to create a control input dataset named continent and store it in myfmt catalog and use the format on continentid var.name of the format is continent
The CNTLIN data set, continent, was created incorrectly.
For the start and label, it assigns only one value which will always map the VALUE continent_ID to the continent_name. I think you likely meant to refer to those as variables not constants.
Remove the quotes around the variables.
FYI - if you post a picture of your code we'll have to explain to you how to modify it.
If you post the actual code, we can show the suggested changes. Post your code and log directly in the future, not an image.
@archita wrote:
Hi all,
I am facing this issue. Please help me with the error. I have a dataset named continent with 2 variables-continentid and continent name. I want to create a control input dataset named continent and store it in myfmt catalog and use the format on continentid var.name of the format is continent
Please post logs as text using this button:
For SAS code, use the "little running man" right next to it.
You assign constant character values to variables start and label; I guess that you wanted to assign the values contained in the variables continent_id and continent_name, so remove the quotes around the variables names.
is continent id char or numeric?
hmm so why did you use $ then if it's a numeric variable?
contentID is not used in your format as shown.
See my previous post.
@archita wrote:
Hi continentid is numeric
The CNTLIN data set, continent, was created incorrectly.
For the start and label, it assigns only one value which will always map the VALUE continent_ID to the continent_name. I think you likely meant to refer to those as variables not constants.
Remove the quotes around the variables.
FYI - if you post a picture of your code we'll have to explain to you how to modify it.
If you post the actual code, we can show the suggested changes. Post your code and log directly in the future, not an image.
@archita wrote:
Hi all,
I am facing this issue. Please help me with the error. I have a dataset named continent with 2 variables-continentid and continent name. I want to create a control input dataset named continent and store it in myfmt catalog and use the format on continentid var.name of the format is continent
data continent;
length continentName $50;
infile datalines truncover dlm='|';
input continent_id continentName $;
datalines;
1|Asia
2|Africa
3|N. America
4|S. America
5|Antarctica
6|Europe
7|Australia
;
run;
proc print data= continent;
run;
data outfmt(keep=start label fmtname);
set continent(rename=(continent_id=start continentname=label));
fmtname='continent';
run;
proc format library=work cntlin=outfmt;
run;
This should do it. next time post sample data as datalines.
Post the complete log of the step that creates the continent dataset. Use this button to post the log (do NOT skip this😞
you seem like you don't listen. people have tried to help you. we gave you multiple solutions and you still ignore our advice 😞
once again, you are not listening. we told you what you have to change in your code. the reason you are getting errors is because you have not implemented the change...
data continent;
set blib.continent;
keep fmtname start label;
fmtname='CONTINENT';
start='Continent_ID';
label='Continent_Name';
run;
proc format library=blib.myfmt cntlin=continent;
select CONTINENT;
run;
This the code I am running currently still getting same error
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.