I'm not certain where I'm missing the closed paranthesis in the below code.
26 data test;
27
28 SCHDLD_OBJ_RUN_STRT_TMST=%sysfunc(floor(%sysfunc(inputn("&etls_stepStartTime",datetime17.)))/60*60);
_
388
200
76
ERROR: Expected close parenthesis after macro function invocation not found.
ERROR 388-185: Expecting an arithmetic operator.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
29 format SCHDLD_OBJ_RUN_STRT_TMST dtfmt.;
30 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 1 variables.
WARNING: Data set WORK.TEST was not replaced because this step was stopped
You are doing a simple assignment in a data step, so the %sysfunc's are unnecessary.
SCHDLD_OBJ_RUN_STRT_TMST = floor(input("&etls_stepStartTime",datetime17.) / 60) * 60;
You need to take more care when copying code suggested by people here. Note that I moved the multiplication out of the floor() call.
Edited to use input instead of inputn, kudos to @Astounding
You are doing a simple assignment in a data step, so the %sysfunc's are unnecessary.
SCHDLD_OBJ_RUN_STRT_TMST = floor(input("&etls_stepStartTime",datetime17.) / 60) * 60;
You need to take more care when copying code suggested by people here. Note that I moved the multiplication out of the floor() call.
Edited to use input instead of inputn, kudos to @Astounding
If you are using the SAS Display Manager (sometimes called Base) interface the enhanced editor has a "find matching parentheses" ability. Place the cursor on a ( , ) , [ , ] , { or } character in the code. Press either CTRL 9 or CTRL 0 (note those are the keys with the ( and ) symbol) or Ctrl [ or Ctrl ] and the editor will show what SAS is currently interpreting to be the matching character.
Note that I did say interpreting, not what you intend.
If the cursor doesn't move then there is no match found by the SAS interpretation rules. So you can go to the last ) and find out which one is the "match". That should give a hint where to start looking for syntax issues.
I never knew enhanced editor did parenthesis matching. Looks like the key combination is: CTRL [ i.e. Ctrl key and the bracket key.
https://v8doc.sas.com/sashtml/win/zenhcded.htm
I was trying CTRL ( by holding down SHIFT CTRL and number 9 at the same time , but didn't have any luck. : )
@Quentin wrote:
I never knew enhanced editor did parenthesis matching. Looks like the key combination is: CTRL [ i.e. Ctrl key and the bracket key.
https://v8doc.sas.com/sashtml/win/zenhcded.htm
I was trying CTRL ( by holding down SHIFT CTRL and number 9 at the same time , but didn't have any luck. : )
Miss typed corrected now
This can be changed in the Enhanced Editor Preferences: Tools>Options>Enhanced Editor Keys. Select Navigation in the top drop down list. Scroll down to Move cursor to matching brace. The list shows
Ctrl+[
Ctrl+]
Ctrl+0
Ctrl+9
as the default defined keys.
Nice, never noticed that. I wish there was a "move cursor to end|beginning of step." That would make it easy to submit the current step where the cursor is located.
Feels like the kind of thing @rogerjdeangelis is likely have working (though perhaps only in the non-enhanced editor)?
I'm using SAS EG 7.15, seems enhance Editor facility is not available in EG.
Enhanced editor is an old PC SAS thing (introduced in v7 I think?). It was enhanced over an even older PC SAS editor window. It brought amazing things to your SAS code, like colors.
EG program editor has just about all the benefits of the enhanced editor and more. For example, parenthesis matching in EG is automatic. When you type a close parenthesis, it highlights the opening parenthesis it matches with. And you can also move the cursor through an expression, and each time it hits a parenthesis, it will highlight the pair.
I don't think you need to turn any option on for parenthesis matching.
I checked Tools->Options->SAS prgorams->Editor Options and didn't see anything obvious.
I'm in EG 7.15 also, and EG has done parenthesis matching as long as I can remember. Maybe ask over in the EG community.
Hi @Babloo,
On the "Appearance" tab in the "Enhanced Editor Options" window (see Quentin's post) there is an item "Parenthesis match highlighting" in the box "File elements." There you can change the "Background" color for that highlighting ("Gray" in the "Default" scheme). If this is set to an inappropriate color (e.g. white on white background or a color that is invisible for some reason on your screen), then, indeed, you won't see the highlighting.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.