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?
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.
Can you please post an example so that we can replicate the issue?
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;
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?
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.
Great, that answers the question! Thanks a lot.
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.
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.