BookmarkSubscribeRSS Feed
ssaha
Obsidian | Level 7

Using ODS CSV, when I am running from a stored process program the data is not getting populated in the csv file. It is showing blank.

 

For your reference, I used this ods csv code. I ran the stored process program from SAS 9.3

 

ods _all_ close;
ods csv file="/trnapp/sas/dev/projects/so/sho/num_as_char28.csv" options(Prepend_Equals='Yes' quote_by_type="Yes" );


proc print data=adw_mwh_to;

run;

ods csv close;

3 REPLIES 3
ballardw
Super User

@ssaha wrote:

Using ODS CSV, when I am running from a stored process program the data is not getting populated in the csv file. It is showing blank.

 

For your reference, I used this ods csv code. I ran the stored process program from SAS 9.3

 

ods _all_ close;
ods csv file="/trnapp/sas/dev/projects/so/sho/num_as_char28.csv" options(Prepend_Equals='Yes' quote_by_type="Yes" );


proc print data=adw_mwh_to;

run;

ods csv close;


Is there any LOG entry related to this? If so show the relevant part. Paste into a code box on the forum opened using the {I} icon to preserve formatting.

From the path you show for the output it is not possible to tell if you path starts at a drive map point or not. If "trnapp" is not a mount point then the output may have been directed to the default SAS executing directory and assumed that you wanted the location subordinate to that location.

Tom
Super User Tom
Super User

Please show example line(s) from the CSV file where the value is not what you expect. use the Insert Code {i} icon to pop-up a window where you can paste the lines of text from the CSV file. Do NOT open the CSV file using Excel. Open it with a text editor so you can see what is in the file instead of what Excel converts it into.

 

Then show the values of the variables in the SAS dataset that you feel are not being represented properly in the CSV file.  Show the data type and any formats attached the variables in question.

Cynthia_sas
SAS Super FREQ

Hi:

  When you use a Stored Process to return results, you should be using %STPBEGIN and %STPEND for the required Stored Process Macro calls that are needed before and after any code that is going to generate streaming output.

 

  So your use of a physical name doesn't look quite right. Or, if you're not going to use %STPBEGIN/%STPEND, then you might use _webout. This previous forum posting in the Stored Process forum has an example of the code I've always used: https://communities.sas.com/t5/SAS-Stored-Processes/How-do-I-export-sas-dataset-to-csv-using-stored-...

 

  Hope this helps. You might also want to post your question in the Stored Process Forum.

 

Cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 3 replies
  • 903 views
  • 0 likes
  • 4 in conversation