Desktop productivity for business analysts and programmers

Modify EG formating for SAS code

Reply
Occasional Contributor
Posts: 9

Modify EG formating for SAS code

[ Edited ]

Can I modify EG so that formatting SAS code doesn't tab "If Then" statements to a seperate lines?

Super User
Posts: 1,111

Re: Modify EG formating for SAS code

Is the query related to indentation in EG
Thanks,
Jag
Occasional Contributor
Posts: 9

Re: Modify EG formating for SAS code

Yes.

 

I am new to EG.  When  I run the EG code formating procedure, SAS indents the if statement to a seperate line.  For example:

 

I want this:

if x=0 then y=1; else

x >0 then y=2; else

x<0 then y=3;

 

What I get is something like:

 

if x=0 then

            y=1;

else

x >0 then

         y=2;

else

x<0 then

          y=3;

 

 

Super User
Posts: 1,111

Re: Modify EG formating for SAS code

The best way is avoid the formatting in EG and you could simply write and apply no formatting
Thanks,
Jag
Super User
Super User
Posts: 6,344

Re: Modify EG formating for SAS code

Could it have something to do with the code being incorrect?

What is with the extra THEN keywords?

I assume you meant something like this.

if x=0 then y=1; 
else if x>0 then y=2; 
else if x<0 then y=3;

Personally I would not use your style becuase it is placing key information (the ELSE keyword) at the end of the line instead of the beginning of the line. This makes it very difficult to quickly scan the code. The beginning of the lines will be alligned, but the ends of the lines will be ragged.

Ask a Question
Discussion stats
  • 4 replies
  • 313 views
  • 1 like
  • 3 in conversation