DATA Step, Macro, Functions and more

1)SAS Linesize option 2) Window-flipping

Reply
Contributor
Posts: 53

1)SAS Linesize option 2) Window-flipping

  1. I attempted to set linesize using the option. Regardless of what number I provide, SAS always goes back to the default value.
  2. When creating RTF tables through ODS, is there any way to keep the active window from changing when running programs interactively (Windows)?


Super User
Posts: 10,497

Re: 1)SAS Linesize option 2) Window-flipping

Some example code of how you are attempting to use linesize would help diagnose the issue.

Valued Guide
Posts: 3,208

Re: 1)SAS Linesize option 2) Window-flipping

for 1/ agree with ballardw.
for 2/ Turn results off.  SAS(R) 9.3 Output Delivery System: User's Guide, Second Edition (ODS NORESULTS)

      13128 - Prevent the Results Viewer from opening automatically when generating output from ODS

---->-- ja karman --<-----
Contributor
Posts: 53

Re: 1)SAS Linesize option 2) Window-flipping

I'm currently using options linesize = xxx;

Super User
Posts: 10,497

Re: 1)SAS Linesize option 2) Window-flipping

Options linesize= indicates how many print columns are available in the text output window (ODS LIsting). It is limited between 64 to 256, at least in 9.2.3. Anything out of that range would be ignored.

What value are you trying to set and does it really need to be the output window? What are you trying to accomplish?

Contributor
Posts: 53

Re: 1)SAS Linesize option 2) Window-flipping

I am writing custom warnings and messages to the log but they keep wrapping to the next line. This creates problems when my programs to read the logs (checking warnings, errors, etc) only gets part of the message because it wrapped to the next line in the log.

Super User
Posts: 10,497

Re: 1)SAS Linesize option 2) Window-flipping

For custom warnings or errors in a datastep it may be better to send them directly to an output set;

Something like:

data want (drop=errormsg) error (keep=errormsg);

     set have;

     length errormsg $ 400 ; /* or as long as you think the message needs to be*/

<misc code>

     if <error condition> then do;

          Errormsg = "Your custom error message";

          put errormsg; /* so it can be seen in log if desired*/

          outpout error;

     end;

<other code>

     output want;

run;

There have been several threads related to parsing log files and all of them seem to have many gyrations to get what you want.

Valued Guide
Posts: 3,208

Re: 1)SAS Linesize option 2) Window-flipping

ad 1) linesize. Is this something happening with 9.3?

  This is the evolving way of leaving the monospace world.

ODS HTML has become the default.  SAS(R) 9.4 Output Delivery System: User's Guide  and   SAS(R) 9.4 Output Delivery System: User's Guide  (Introduction to the Output Delivery System).

HTML does not know linesizes and pagesizes like the old hardcopy paper experience.

The old ls/ps are still there but are getting overruled (ballardw) sometimes (datapage)

- SAS(R) 9.3 System Options: Reference, Second Edition

- 6028 - ODS RTF and ODS PDF reset LINESIZE and PAGESIZE values

---->-- ja karman --<-----
Super Contributor
Posts: 358

Re: 1)SAS Linesize option 2) Window-flipping

Two things to try:

1) Use: ODS LISTING FILE="mvs.file.name" and then use PROC PRINT.  This may bypass the pagesize/linesize limits.  I would preallocate the output file with the attributes you want first.

2) Use a FILE statement and write the data with PUT statements.  Files can be up to 32,767 char wide (the MVS limit last I heard - may have changed since).

Ask a Question
Discussion stats
  • 8 replies
  • 427 views
  • 0 likes
  • 4 in conversation