BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
erickdt
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
You have your START and LABEL variables set backwards. Try reversing them and see if that's what you want. START is what your variables currently look like, LABEL is what you want them to look like.

View solution in original post

4 REPLIES 4
Reeza
Super User
You have your START and LABEL variables set backwards. Try reversing them and see if that's what you want. START is what your variables currently look like, LABEL is what you want them to look like.
erickdt
Obsidian | Level 7

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!

Reeza
Super User

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:

https://documentation.sas.com/?docsetId=proc&docsetTarget=n1e19y6lrektafn1kj6nbvhus59w.htm&docsetVer...

 


@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!


 

Tom
Super User Tom
Super User

Why are you defining a character format using numeric variables?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 672 views
  • 0 likes
  • 3 in conversation