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

Hi all,

I had a problem yesterday. I was trying to create both numeric and character formats from and input control data set.  I ended up having to do the numeric ones separate from the character ones.  The program gave me an error (ERROR: Start is greater than end: -. missing end) when the END variable existed and there was no value in it.  This happened when it wasn't a range, just one value in START, for character formats.  So the workaround was to have both START and END in the input control dataset for the numeric formats, and just START in the character formats.  Have any of you encountered this? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Where you add it ... depends on how you are constructing the CNTLIN= data set.  You might have to modify the statement to:

 

if end = '  '  then end = start;

 

But this sort of a statement likely becomes part of the creation of the CNTLIN= data set.

 

If you have a more complex situation where you are concatenating a series of data sets to form one large CNTLIN= data set, you might use in= variables:

 

data all_formats;

set character_formats (in=in1) numeric_formats (in=in2);

if in2 then end=start;

 

But the bottom line is that when you have both START and END in your data set, you need to treat them as if they are forming a range. 

View solution in original post

5 REPLIES 5
Reeza
Super User

Can you please post an example so that we can replicate the issue?

Astounding
PROC Star

If you have both START and END in your data, and you want it to be treated as a single value rather than a range, just code:

 

end = start;

 

 

evp000
Quartz | Level 8

Thanks for your resonses. I'll post an example shortly, but as for "end=start", how/where do I code that for an input control dataset when sometimes I have an END value, and sometimes I don't? 

Astounding
PROC Star

Where you add it ... depends on how you are constructing the CNTLIN= data set.  You might have to modify the statement to:

 

if end = '  '  then end = start;

 

But this sort of a statement likely becomes part of the creation of the CNTLIN= data set.

 

If you have a more complex situation where you are concatenating a series of data sets to form one large CNTLIN= data set, you might use in= variables:

 

data all_formats;

set character_formats (in=in1) numeric_formats (in=in2);

if in2 then end=start;

 

But the bottom line is that when you have both START and END in your data set, you need to treat them as if they are forming a range. 

evp000
Quartz | Level 8

Great, that answers the question!  Thanks a lot. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1936 views
  • 3 likes
  • 3 in conversation