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. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1005 views
  • 3 likes
  • 3 in conversation