Desktop productivity for business analysts and programmers

Differences using PC SAS 9.2 and EG SAS 4.2

Reply
N/A
Posts: 0

Differences using PC SAS 9.2 and EG SAS 4.2

I had a difference using PC SAS 9.2 and EG SAS 4.2 that came up the other day with my co-workers. We often have to repeat a variable name while using the Proc Print statement. We found these differences and were wondering if you guys/girls had picked-up this repeating variable before today.


Program in PC SAS 9.2

data one;
input x1 x12 x3 x4;
datalines;
1 2 3 4
5 6 7 8
9 10 11 12
;
proc print uniform;
var x1 x12 x1 x3 x4 x3;
run;

___________

Output in PC SAS 9.2
Obs x1 x12 x1 x3 x4 x3
1 1 2 1 3 4 3
2 5 6 5 7 8 7
3 9 10 9 11 12 11


Program and text using SAS EG 4.2:
After checking all boxes of the result formats (SAS report, HTML, PDF, RTF and Text output) on Results General Panel, I then ran the SAS program in SAS EG 4.2. Here are the results for all result formats:

1. SAS Report- rename variable if a variable is listed more than once in PROC PRINT statement. So, we have variables x1, x12, x122, x3, x4, x32. Notice variable x122 is printing variable x1 but it could not label it x12 because that variable exists.


2. HTML-Printed the variables as SAS 9.2.

3. PDF –Printed the variables as SAS 9.2.

4. RTF –Printed the variables as SAS 9.2.

5. Text output- dropped the variable if a variable is listed more than once in PROC PRINT statement. So for Text output the variables are X1, x12, x3, x4.


As you can see, I got the same output for HTML format, PDF format and RTF format. However, SAS report does rename variable if a variable is listed more than once in PROC PRINT statement. On the other hand, Text Report drops the additional variable if a variable is listed more than once in PROC PRINT statement.

I do not know the reason why SAS report format and Text Report format print differently. I think there is a reason for that.

Maybe, you will take this program and try running it in SAS 9.2 and EG 4.2!

Have a good weekend!
Respected Advisor
Posts: 4,137

Re: Differences using PC SAS 9.2 and EG SAS 4.2

Hi SassyGirl

SAS EG is a client. The SAS code is processed on the server.

Using SAS EG: Are you observing this differences when executing the code on the server "local" (which then would be your PC SAS)?

SAS EG might add some pre- and post- code before sending the code to the server - but I wouldn't know how this could lead to what you describe.

I don't have SAS 9.2 at hand "right now" but I'm very interested if someone else with the same versions than you can replicate this behaviour. If yes: That would be something for Tech Support.

Regards, Patrick
Trusted Advisor
Posts: 2,114

Re: Differences using PC SAS 9.2 and EG SAS 4.2

The "list data" task will not allow you to use the same variable more than once in an EGuide generated PRINT task, so I'm assuming that SassyGirl is using the programming interface to generate the output. If so, then all the work is being done by SAS 9.2 and the only addition that EGuide may make is to append some pre- or post- code.

I don't have EGuide 4.1 installed currently, but I believe that same behavior existed there.

Chris@SAS included the instructions to show the entire log in
http://blogs.sas.com/sasdummy/index.php?/archives/131-Do-me-a-favor-stop-doing-me-favors.html

Doc
Ask a Question
Discussion stats
  • 2 replies
  • 101 views
  • 0 likes
  • 3 in conversation