BookmarkSubscribeRSS Feed
sathya66
Barite | Level 11

All,

I have created a job which creates a CSV which runs as SAS job in DI. The issue that I am facing is that when I run the DI job manually , the file gets populated correctly, however now I have put the job in the scheduler the file doesnt get populated correctly. Is there anything that I am doing wrong
 

 

 ods csv file="ODS_CSV.csv";
     proc print data=sashelp.class;
	     title "&sysver";
		 footnote "&sysdate";
     run;
   ods csv close;
7 REPLIES 7
Kurt_Bremser
Super User

What do you mean by "not correctly populated"?

 

And why so complicated? A simple PROC EXPORT does the same (minus the observation numbers), and will perform better.

And I suspect there is a dedicated export task in DI Studio.

 

Anyway, look at the log of the job that did not work as expected.

sathya66
Barite | Level 11
Yes, I used PROC EXPORT insated of ods csv . this is a user written code and not using proper DI.
its just not exporting the CSV file.
which one is best? is it PROC EXPORT or ODS CSV?
Kurt_Bremser
Super User

Since PROC EXPORT creates a data step and runs it, it will outperform ODS CSV, by orders of magnitude once the size of the data grows.

And if you have an export task available in DI Studio, it is recommended to use that. The less user-written code, the easier to work with (if you are a DI user, which I am not).

ballardw
Super User

@sathya66 wrote:
Yes, I used PROC EXPORT insated of ods csv . this is a user written code and not using proper DI.
its just not exporting the CSV file.
which one is best? is it PROC EXPORT or ODS CSV?

What exactly does the LOG show from that part of the job?

sathya66
Barite | Level 11
It is executing fine without errors but not saving the file on the server. its strange.
ballardw
Super User

@sathya66 wrote:
It is executing fine without errors but not saving the file on the server. its strange.

The log should show exactly where the file was written. The log after the ODS CLOSE should show something like

NOTE: Writing CSV file: X:\<path information>\<filename.csv>

as appropriate for your operating system and code

Sajid01
Meteorite | Level 14

Hello @sathya66 
I suggest you give the full path in the statement  ods csv file="/full_path_here/ODS_CSV.csv";
Please check your DI job settings.
Please share your outcome

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1803 views
  • 0 likes
  • 4 in conversation