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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.