BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Alecs
Calcite | Level 5

Hello

 

I'm working with SAS 9.4 and I try to run via a shell a SAS script on a UNIX platform. Within the SAS script there is my most important step that is a proc export of a small dataset to csv. But my sas script stops miraculously just when the proc export should begin. Even my log file doesn't contain any errors, it just stops and that's it. All the datasets before the proc export are correctly created, the proc export and all the following datasteps are just ignored. If a replace the proc export by an ordinary datastep everything works fine again

 

Does anybody know what's happening?

 

Thanks in advance

Alex

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Run the batch script with -logparm WRITE=IMMEDIATE for SAS.

And please post your proc export code.

Have you checked the log you get for any WARNINGs, ERRORs or extraneous NOTEs before it reaches the supposed export step? Make your code clean.

What happens when you run the same code in an interactive session?

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

Run the batch script with -logparm WRITE=IMMEDIATE for SAS.

And please post your proc export code.

Have you checked the log you get for any WARNINGs, ERRORs or extraneous NOTEs before it reaches the supposed export step? Make your code clean.

What happens when you run the same code in an interactive session?

Alecs
Calcite | Level 5

Hi Kurt,

 

Thank you for your answer.

 

Here is my proc export:

 

PROC EXPORT DATA= OUTT.CASES_&mannoc.

            OUTFILE = toto

            DBMS=DLM REPLACE;

                     DELIMITER=";" ;

                     PUTNAMES=YES;

RUN;

 

I can't recognize any problems, the macro variable &mannoc. is correctly assigned but it still doesn't work. Is there a problem with this kind of proc export on a Unix platform?

 

Thanks for information if you see anything.

 

Greetings

A.

Kurt_Bremser
Super User

How does your filename statement for toto look?

Have you checked the log, as I suggested? And please supply the values of the macro variables used. If necessary, insert %put statements immediately before their use.

Alecs
Calcite | Level 5

Hello Kurt

 

I tried the following line in an emulator (putty): sas -logparm write=immediate bgsa_sedex_test.sas &. The result is that I have indeed

now a log file which gives me at the last place - juste after the proc export - the following ERROR message:

 

ERROR: The connection to the X display server could not be made. Verify that the X display name is correct, and that you have

access authorization. See the online Help for more information about connecting to an X display server.

 

This is a hint, I try to understand this message by googling, but what is missing then in my proc export procedure?

 

You will find here the whole proc export with the filename declaration :

 

filename toto '/data/dwh1/dwh/data/misc/seco/outest/finalds_alk0457.csv';

 

proc export data=outt.cases_&mannoc.

outfile=toto

dbms=dlm replace;

delimiter=";";

putnames=yes;

run;

 

Thanks in advance

Alecs

Alecs
Calcite | Level 5

Hello

 

I found the solution of my problem!!

 

It's just an option that was missing in my shell script, the -noterminal option. Since I added it, proc export works again. Why proc export on a Unix platform tries to connect to the X server is another question but at least my script works now.

 

Thanks very much to Kurt for his input to make appear the error message in the logfile (-logparm write=immediate), this helped me to resolve this problem!

 

Greetings

Alecs

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2794 views
  • 1 like
  • 2 in conversation