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
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?
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?
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.
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.
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
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: