ctrl+e doesn't clear output window but exits SAS program? - sas

when i tried to clear the output window using ctrl+e, it terminated SAS. My SAS version is 9.3M2. Has anyone encountered the same problem? Thanks.

Looks like there is a hot fix for this. It is supposed to be fixed in 9.3TSM2, so if it is not you may need to contact SAS support.
The kb article with the hot fix is located currently here (kb# 45003).

While not exactly what you are asking, we hot-key the clearing of the log and output so someone doesn't accidentally CTRL-E their program window.
Type keys in the command box
Type output;clear;log;clear;wpgm into the command for a key (we use F12)
This will clear the log and output windows and bring the current program editor to focus.

Related

How to open and close the Log window via code?

My Log window seems happend some font cahe issue, Sometimes it suddenly makes the font BOLD and that bothered me these days. Here is my first question: Dose anybody has any hints about the font issue?
Forunately I find the Log window return to normal if only I close and reopen it, so here comes my
second question: Is it possible to open and close the Log window in SAS DMS? If so, how to write it?
Use the DM statement to programmatically submit available SAS Commands under Windows or SAS Display Manager Windows Window Commands and most important for this question SAS Windows and Access Methods
The LOG command has a seemingly undocumented (online web docs) option OFF. There is likewise a seemingly undocumented command CLEAR. These commands are documented in Windows DM via F1 (Help) -- do a Quick Search for "SAS Windows and Access Methods".
DM 'CLEAR LOG; LOG OFF' LOG;
You might also want to check the DM windows font setting. Submit or issue DLGFONT
DM `DLGFONT`;
Finally, worst case, there is a possibility the SAS DM configuration file is damaged. Locate regstry.sas7bitm, profile.sas7bcat in the sasuser operating system folder and , when SAS is closed, rename them so they are recreated anew at the next DM SAS session start.
If you are using a different SAS client, update your question and add your system setup.

Forcing a terminal windowl of set size to open in C++

My question regards c++ and trying to create a window to ensure my output is all fit into a single line. The only way I can think to do this is to force another window to open up upon running the program and have the output appear there.
Does anyone know how to do this?
I am using XCode on my Mac. Anything Helps!
The best you can do is to adjust your code to format the line within the bounds of the terminal you are using. For this, on OSX, you will need to use (and link) against termcap (short for 'terminal capabilities')
See also this one.

SAS Error Handling in Windows Batch

I have a scheduled SAS program in Windows, e.g.
sas.exe -nosplash -icon -sysin "myprogram.sas"
This process will hang if there's an "Out of Resources" error (e.g. no disk space), prompting for user input (Retry, Cancel, etc.). As it's a batch job, there is no user to give that input.
Is there a SAS system option which prevents the prompt for user input so it can be dealt with in the code itself?
How about -noterminal?
Extract from documentation:
If NOTERMINAL is specified, dialog boxes are not displayed.
Trying using the option
-batch
Since you are running in batch mode, also consider using the option
-errorabend
The best option is
-get_more_resources ;)
If the program is the cause to the resource error you have another question to ask!

Clearing Screen in C++/XCode

I am trying to write up a C++ program for a class using XCode. One of the things I wish to do, is to simply clear the screen. I've looked into how to do this, however the catch is that the code needs to run on both a Windows and Macintosh computer. I've looked at some other similar questions, but none of the answers help me. I know there is no "screen" but I want the system to clear the output window. I know that the command system("clear"); does what I want it to, but when XCode tests the program, instead of clearing the screen it prints TERM Variable not set
I've tried opening up the terminal and typing clear and it does in fact respond the way I want it to, so why doesn't the 'terminal' inside of XCode do the same? I just want to get the output window in XCode to respond to clear the same way that the terminal already does.
Here is something I have already tried;
I went to the terminal and ran echo $TERM, to which the terminal responded xterm-256color. I then went over to XCode and opened the "Scheme" settings, and found an Environment Variables setting under "Arguments". I added a variable (to the blank list) called TERM and gave it value xterm-256color. Upon running the program again, the output displays ¿[H¿[2J in the output window, positioned where the TERM Variable not set used to be printed.
Last thing, as a reminder, I cannot change the source code from the way it is now, or it could cause errors when the program is run on a Windows machine.
It does not work because you are "lying": The terminal in Xcode is not a xterm-256color, but it is dumb terminal. More precise, the display represents a NSTextStorage that collects stdout and/or (depending on target switch) stderr.
A dumb terminal is not able to clean the display. If you want to change this, you can write a plug-in similar to Xcode-Colors what adds the ability to understand ansi color codes.
However, if your requirement that the code simply run at Windows and OSX, you may stick with your solution system("clear"), since it works prefectly in the "normal" OSX terminal.

A terminal-like window for wxWidgets?

I'm looking to add an element to my wxWidgets GUI that behaves like a terminal emulator. Not in terms of a shell which executes commands, but just the input-output setup of an application running in a terminal.
Basically, the requirements are:
Streaming input/output: When you enter a character, it is added to an input stream, and when something is piped to the terminal, it prints out immediately.
No editing: Once you type in a character, it's permanently there, since it's probably been consumed by the application running in the terminal.
Some sort of scrolling (even if it just shows a few lines or something).
It would be nice if there is something that already does this, but suggestions on how to implement this with already existing controls such as wxTextCtrl would also be welcome.
I know this is a couple weeks late, but hopefully it's still useful. I've got a project called Chameleon that uses a wxWidgets-based VT100 terminal widget, which was itself based off of a project called taTelnet. The Chameleon source is available from my website (download page here). Not sure if it's exactly what you're looking for, but it might give you some ideas. Feel free to let me know if you have any questions about it.
wxWidgets supports redirecting STDOUT to a wxTextCtrl via wxStreamToTextRedirector. As for input, you could override the OnChar event in a wxTextCtrl-derived class to handle this.