DATA Step, Macro, Functions and more

Input Control data set for creating formats

Accepted Solution Solved
Reply
Contributor
Posts: 74
Accepted Solution

Input Control data set for creating formats

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? 

 

 


Accepted Solutions
Solution
‎03-22-2016 02:25 PM
Super User
Posts: 5,496

Re: Input Control data set for creating formats

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


All Replies
Super User
Posts: 19,769

Re: Input Control data set for creating formats

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

Super User
Posts: 5,496

Re: Input Control data set for creating formats

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;

 

 

Contributor
Posts: 74

Re: Input Control data set for creating formats

Posted in reply to Astounding

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? 

Solution
‎03-22-2016 02:25 PM
Super User
Posts: 5,496

Re: Input Control data set for creating formats

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. 

Contributor
Posts: 74

Re: Input Control data set for creating formats

Posted in reply to Astounding

Great, that answers the question!  Thanks a lot. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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