DATA Step, Macro, Functions and more

cursor doesn't go all the way back when I press Enter

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

cursor doesn't go all the way back when I press Enter

I'm working with a simple LIBNAME statement:

 

libname epdbprd

        oracle

        user = eppuser

        pass = Coffee1820

        path = EPDBPROD

        schema = eptsprd;

 

When I hit enter after the last line's semicolon, the cursor returns to being directly under the "s" in "schema" rather than all the way back to the first space all the way to the left. And if I hit Enter again, it does the same thing.

 

Why is this happening, and what can I do to make it stop?

 

Thanks.

 

faba_calculo


Accepted Solutions
Solution
‎03-31-2017 08:23 PM
Community Manager
Posts: 2,955

Re: cursor doesn't go all the way back when I press Enter

If using SAS Enterprise Guide, visit Program->Editor Options, and select None for Indentation:

 

ind.png

In Base SAS, it's under Tools->Options->Enhanced Editor Options, the General tab.

View solution in original post


All Replies
Super User
Super User
Posts: 7,070

Re: cursor doesn't go all the way back when I press Enter

Posted in reply to faba_calculo

Annoying isn't it?  It is trying to help you keep your code consistently indented.

 

What user interface are you typing into?  SAS/Studio? Enterprise Guide? Display Manager using the Enhanced Editor? Or the Progam Editor?

New Contributor
Posts: 3

Re: cursor doesn't go all the way back when I press Enter

Yes and figured, in that order.   ;-)

 

And I'm using the Display Manager using the Enhanced Editor.

 

Any ideas?

 

Btw, thanks for the quick response.

 

faba_calculo

Solution
‎03-31-2017 08:23 PM
Community Manager
Posts: 2,955

Re: cursor doesn't go all the way back when I press Enter

If using SAS Enterprise Guide, visit Program->Editor Options, and select None for Indentation:

 

ind.png

In Base SAS, it's under Tools->Options->Enhanced Editor Options, the General tab.

New Contributor
Posts: 3

Re: cursor doesn't go all the way back when I press Enter

Posted in reply to ChrisHemedinger

We have a winner!

 

Man, I NEVER would have found that. Sixteen years of SASing, and I've really never explored a lot of the menus.

 

Thanks again, Chris!

 

Faba_Calculo

Super User
Posts: 11,343

Re: cursor doesn't go all the way back when I press Enter

Posted in reply to faba_calculo

As I would prefer to keep the intending working another approach is to have the ; on its own line in the left margin:

libname epdbprd 
        oracle
        user = eppuser 
        pass = Coffee1820
        path = EPDBPROD
        schema = eptsprd
;

This way you can easily align your multiple parameters (or WHEN statments, or plot options or...) but the next line will start on theleft.

 

Also you you may find that backspace will undo levels of indenting by the increment set in many places

if some condition then do;
   statment;
   if other condition do;
      statement;   /*use tab for one level of indent*/
      statement;   /*After entering this line use backspace*/
   end;            /* and the "end" aligns with the IF*/
   else do;
      statement;
      statement;
      statement;
   end;
end;

but the auto indent has to be set for that to work.

 

☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 178 views
  • 0 likes
  • 4 in conversation