BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hi ,

 

I am createing format by using attached excel sheet , but i am getting below error.

 

Error: For Format VISIT_FMT , this range is repeated, or values overlap: .-..;

 

proc format cntlin=in_excel_ds;run;

Thank you,

Rajasekhar.

2 REPLIES 2
Reeza
Super User

EDIT: Tested and confirmed - you have duplicates - find and remove those - use PROC SORT. 

You also need to tell SAS it's a character format - TYPE=C. Add that into the data set and it works fine.

 

79
80 proc format cntlin=Sorted;
NOTE: Format $VISIT_FMT is already on the library WORK.FORMATS.
NOTE: Format $VISIT_FMT has been output.
80 ! run;
Tom
Super User Tom
Super User

From browsing the XLSX file in this forum you appear to have two different formats in that same XLSX file that are both trying to use the same NAME.  Notice how you have two **OTHER** start values?

 

The first one is probably a character format and the second one looks like a numeric format. So either add a FMTTYPE variable or add the $ to the front of the name of the character format. Or do both.

 

You probably do not want both a START and an END for a CHARACTER format.  Ranges of character values are messier for text with varying lengths. And it looks like you also don't need them for the numeric format.  I did not notice any cases in scanning the file where END is different than START.  So just drop END and avoid the risk of it accidentally being different and causing a range of values instead of a single value.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 646 views
  • 0 likes
  • 3 in conversation