Is there a keyboard shortcut--like there is in RStudio--that copies the current line of code to the next line.
/* For example: I may want to duplicate a class statement for another procedure. I often find that I need to re-use a line in another procedure*/
PROC LOGISTIC DATA=HAVE
CLASS X Y Z;
MODEL A = X Y Z;
RUN;
PROC LOGISTIC DATA =NEXT;
/*PUT COPIED STATEMENT HERE*/
That shortcut is Shift+Alt+Down arrow in RStudio. I could not find such a shortcut in the list of shortcuts in EG, but perhaps I'm overlooking something.
I don't think that's an option, which sort of makes sense in SAS, the lines don't build on one another like they do in R. Can you give an example of how/when that would be used? It woudn't make sense for the example you posted since you would never have two proc statements back to back like that.
@svh wrote:
Is there a keyboard shortcut--like there is in RStudio--that copies the current line of code to the next line.
/* For example: I may want to duplicate a class statement for another procedure. I often find that I need to re-use a line in another procedure*/ PROC LOGISTIC DATA=HAVE CLASS X Y Z; MODEL A = X Y Z; RUN; PROC LOGISTIC DATA =NEXT; /*PUT COPIED STATEMENT HERE*/
That shortcut is Shift+Alt+Down arrow in RStudio. I could not find such a shortcut in the list of shortcuts in EG, but perhaps I'm overlooking something.
That was admittedly a poor example, but I work with a lot of data that needs to be recoded, so I'm frequently writing lines like the following:
else if Q2 = 2 then Program = 'Emergency Medicine';
It's rather easy to copy the line with a quick keyboard shortcut. But thank you for pointing out that this is not a feature in SAS EG.
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.