Hi there!
I got the follow error when I try to use CNTLIN:
ERROR: For format $CD_BLOQUEIO, this range is repeated, or values overlap: 16-16.
data BASE;
input CD_BLOQUEIO CD_PESO;
datalines;
57 3
58 4
59 5
60 16
61 16
62 1
;
DATA CD_BLOQUEIO ;
SET BASE (RENAME = (cd_peso = START CD_BLOQUEIO= LABEL));
FMTNAME = "$CD_BLOQUEIO" ;
RUN;
PROC FORMAT
CNTLIN = CD_BLOQUEIO;
RUN;
My format should be based on "CD BLOQUEIO"....
If CD BLOQUEIO equal 60 my result applyng format should 16 ,as well if my CD_BLOQUEIO equal 61.
Is it rigth? Thanks in advanced
Hi Reeza, thanks for the fast reply... it works!
however i have another question....
In my case I've COD_BLOQUEIO equal 72 and isn't at the format.... applying the format my variable keep still the same value "72".. is it possible "clean" the value of the variable if value isn't at the format? thanks in advanced, again!
You can use the OTHER option to create a format value for anything not in your list.
In this example it's set to error but you can set it to whatever you'd like:
@erickdt wrote:
Hi Reeza, thanks for the fast reply... it works!
however i have another question....
In my case I've COD_BLOQUEIO equal 72 and isn't at the format.... applying the format my variable keep still the same value "72".. is it possible "clean" the value of the variable if value isn't at the format? thanks in advanced, again!
Why are you defining a character format using numeric variables?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.