Hi,
Failed to create PDF file in my local drive, even after using ODS statement. Please make use of the below program.
Also, Please explain why we are not using "run" statement after ods pd close?
data construction;
input Items $ Qty Rate instock sold;
cards;
Bricks 1 35 1485 2453
Paint 1 45 1487 2658
Lader 1 75 1224 2014
Hammer 1 50 1789 2369
Nail 1 5 1258 458
;
run;
proc print data= construction;
run;
ods pdf file= "T:\SAS\ODS statement\construction.pdf";
title="Purchase_list";
proc print data= construction;
run;
ods pdf close;
LOG:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 data construction;
75 input Items $ Qty Rate instock sold;
76 cards;
NOTE: The data set WORK.CONSTRUCTION has 5 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
82 ;
83 run;
84 proc print data= construction;
85 run;
NOTE: There were 5 observations read from the data set WORK.CONSTRUCTION.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.08 seconds
cpu time 0.07 seconds
86 ods pdf file= "T:\SAS\ODS statement\construction.pdf";
NOTE: Writing ODS PDF output to DISK destination "/opt/sasinside/SASConfig/Lev1/SASApp/T:\SAS\ODS statement\construction.pdf",
printer "PDF".
87 title="Purchase_list";
_____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
88 proc print data= construction;
89 run;
NOTE: There were 5 observations read from the data set WORK.CONSTRUCTION.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.06 seconds
cpu time 0.05 seconds
90 ods pdf close;
ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/T:\SAS\ODS statement\construction.pdf.
91
92 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
105
Many thanks,
Deepak.
Hi Anushree,
Many thanks for your advice, I have removed the "=" in title and changed the ods file path to UE server, Now the program works fine with no errors!
Regards,
Deepak.
From the error message it looks like your SAS program is running on a remote SAS server with the Unix operating system. As such it know nothing about Windows file paths on your local PC. Ask your SAS admin to advise you where you can write your files on the server preferably so they can be shared with your PC.
Got the point, I use UE for practice, So this is a cloud service which is not related to my windows drive, Now I changed the path by creating a folder in the UE itself and the program works fine! Many thanks for your prompt support!
data construction;
input Items $ Qty Rate instock sold;
cards;
Bricks 1 35 1485 2453
Paint 1 45 1487 2658
Lader 1 75 1224 2014
Hammer 1 50 1789 2369
Nail 1 5 1258 458
;
run;
proc print data= construction;
run;
ods pdf file= "/folders/myshortcuts/Myfolders/ODS statement/construction.pdf";
title"Purchase_list";
proc print data= construction;
run;
ods pdf close;
Hi,
1. There is a problem with your Title statement. It shouldn't have = sign.
2. Secondly, I think you need to check your path where you want the output. I used your code with these changes, and its working perfectly fine for me.
3. ODS statement is a global statement. That's why we don't have to use run after that.
data construction;
input Items $ Qty Rate instock sold;
cards;
Bricks 1 35 1485 2453
Paint 1 45 1487 2658
Lader 1 75 1224 2014
Hammer 1 50 1789 2369
Nail 1 5 1258 458
;
run;
proc print data= construction;
run;
ods pdf file= "/home/anushreebiotech0/ECRB94/data/construction.pdf";
title "Purchase_list";
proc print data= construction;
run;
ods pdf close;
Regards,
Anushree
Hi Anushree,
Many thanks for your advice, I have removed the "=" in title and changed the ods file path to UE server, Now the program works fine with no errors!
Regards,
Deepak.
@Deepak13 Please mark the solution that solved your issue in-order to close the thread.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.