Desktop productivity for business analysts and programmers

How to prevent code going to next line in SAS EG export

Reply
Contributor
Posts: 56

How to prevent code going to next line in SAS EG export

Hi All,

I am using SAS EG 4.3 with sas 9.2 in linux . Whenever I export codes from SAS Enterprise guide to some external files(notepad or putty in linux) I see some lines of code goes to next line.

may be after certain width. Is there any way to change settings somewhere so that I get my code exactly coded in SAS EG i.e without going to next line?

From execution point of view it is not a problem but I loose readability in exported file.

Also after export I transfer file to linux and use putty with VI editor to open it.

For example

*******************************************************************************************;

* CLEARS                                                                                                 exlinee*;

*******************************************************************************************;

becomes as below in exported files

*******************************************************************************************;

*

CLEARS

*;

*******************************************************************************************;

Super User
Super User
Posts: 7,675

Re: How to prevent code going to next line in SAS EG export

It looks to me like you are tabbing things across the screen.  The tab character is interpreted in different editors to mean different spacing.  The way to fix this is to not use the tab character, but to put spaces in.  SAS Enhanced Editor (not sure about EG) has the ability to replace tabs with spaces so you can still press the tab key.  This is under, Tools->Options->Enhanced Editor.  You can select replace tabs with blanks, and how many blanks.  I tend to put 2 for a tab.  Try just using spaces, it should fix your problem, although why is exlinee in the first an not the second?

Super User
Posts: 7,379

Re: How to prevent code going to next line in SAS EG export

EG has the same options: set tab width, replace tabs with spaces on loading, insert spaces when tab is used.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 56

Re: How to prevent code going to next line in SAS EG export

I set option "insert spaces to tabs" in SAS EG - options-sas programs-editor options. But of no help. I have always used spaces instead of tab.

to do testing if it helps , I wrote only few lines and notice that if statement is going beyond column 80 then in exported code sas statement goes to next line where it finds first space before column 80 .

If I have only ******************************************************************************************************************************************************;

going beyond 80 columns then apparently SAS considers it one string and in exported code it remains on same line.

Is it true? can we change it somewhere ? Or at least does SAS has any documentation on this?

regarding "exlinee" . I do not know how did it arrive there but it was not in my editor when I pasted.

PROC Star
Posts: 1,143

Re: How to prevent code going to next line in SAS EG export

How are you exporting it? I only have EG 6.1, but the following two methods don't introduce the problem you're describing:

- Copy and paste into a Notepad session;

- Highlight the program in the process flow, and click Export | Export Program...

Tom

Contributor
Posts: 56

Re: How to prevent code going to next line in SAS EG export

When I paste in notepad file it is not a problem. it arises only when I do export program. I wanted to share some screenshot but SAS page is not doing that for the moment. so I can't upload images.

Super User
Posts: 11,101

Re: How to prevent code going to next line in SAS EG export

In NOTEPAD ensure that the FORMAT menu item Word Wrap is not checked. If it is then Notepad wraps the text to fit the displayed window size. It has nothing to do with the actual length of the line you export but the size of the window.

I would look for something similar related to Putty.

Contributor
Posts: 56

Re: How to prevent code going to next line in SAS EG export

I tried to uncheck 'word wrap' and it did not help.

I tried to upload some images which could have helped in much better way to understand this issue. But looks like that SAS community page is not allowing to upload the images .

SAS Super FREQ
Posts: 305

Re: How to prevent code going to next line in SAS EG export

This is a bug in EG 4.3 that was fixed in EG 5.1 (and later).  I am easily able to reproduce this issue in EG 4.3 (by pasting the "For example" code in the original post into a code node, then selecting Export->Export Program... to export).  I also confirmed the issue does not occur in 5.1, 6.1, 7.1, or 7.11.

Contributor
Posts: 56

Re: How to prevent code going to next line in SAS EG export

Thanks CaseyS@SAS. Do you have any SAS note or paper where this is mentioned . I ask just to refer in detail if possible.

SAS Super FREQ
Posts: 305

Re: How to prevent code going to next line in SAS EG export

I found the entry in our internal tracking system related to this issue, but I did not find an associated SAS Note, and I doubt it is covered in any paper.  I confirmed it was a bug in 4.3 and has been fixed.

A little more detail:

The cause of the bug is the fact that EG 4.3 attempted to auto-wrap code lines when exporting, so that the line lengths would not be too long (thus more likely to run on other servers with potentially different line length limits).  EG 5.1 and later do not attempt to auto-wrap code lines when exporting, both since we weren't able to do it reliably in all scenarios and since the more reasonable expectation is that exported code will be *exactly* the same (line lengths and all) as what was in the editor.

Ask a Question
Discussion stats
  • 10 replies
  • 733 views
  • 3 likes
  • 6 in conversation