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

Hi Team,

I was trying to use ODS tagsets so that Formats apply accordingly. Otherwise with just the Export to Excel formats were not getting applied in the sheet.

I thought I could Just use:

ods tagsets.excelxp file="C:drive\colect121011001(2)\colect.xml";

data final;

set procedures_descrip2;

run;

ods tagsets.excelxp close;

BUT ONLY AFTER USING THE BELOW CODE I GET THE RESULT.

ods listing close;

ods tagsets.excelxp file="C:\Data\Projects\Colectomy-20121011001(2)\colectomy.xml";

data final;

set procedures_descrip2;

file print ods;

put _ods_;

run;

ods tagsets.excelxp close;

ods listing;

My Question is why do we have to use statements???

ods listing

file print ods

put _ods_

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

ODS basically handles print output. A data step by itself doesn't create any output unless you use one of the options to create "print" data. The FILE PRINT ODS; statement says "if this data step creates any print type output, direct it to the ODS handler". The PUT _ODS_; says to create the print type output.

The ODS listing is to reopen the output destination after you had closed it with the ODS LISTING CLOSE; statement.

Without that your next output attempt would like generate a "No output destinations are open" error. It is only needed if you have closed the listing destination, i.e. the output window in 9.2 and earlier.

View solution in original post

2 REPLIES 2
ballardw
Super User

ODS basically handles print output. A data step by itself doesn't create any output unless you use one of the options to create "print" data. The FILE PRINT ODS; statement says "if this data step creates any print type output, direct it to the ODS handler". The PUT _ODS_; says to create the print type output.

The ODS listing is to reopen the output destination after you had closed it with the ODS LISTING CLOSE; statement.

Without that your next output attempt would like generate a "No output destinations are open" error. It is only needed if you have closed the listing destination, i.e. the output window in 9.2 and earlier.

robertrao
Quartz | Level 8

Hi,

Thanks a lot for the detailed information.

Regards

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!

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.

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
  • 2 replies
  • 715 views
  • 0 likes
  • 2 in conversation