Multiple title using CSVALL

Reply
N/A
Posts: 1

Multiple title using CSVALL

Within a single CSV I want to print four dataset ( having max of 10 observation)  one below the other. I want to have separate title for each of these dataset. How to do it?

Thanks in Advance

Grand Advisor
Posts: 10,215

Re: Multiple title using CSVALL

Please provide an example of what you have attempted.

The general approach for sending multiple outputs for any ODS destination is:

ODS <destination specific information such as tagset, file and options>;

<generate output>

<generate output>

<generate output>

...

ODS <destination> close;

Grand Advisor
Posts: 17,383

Re: Multiple title using CSVALL

Would that still be considered a CSV at that point?

PS I would hate to receive that file

Grand Advisor
Posts: 10,215

Re: Multiple title using CSVALL

I am hoping the OP is inconsistent in use of CSVALL and CSV.

From the description of CSVALL:

... CSVALL destination, which produces HTML output containing columns of data values

that are separated by commas, and produces tabular output with titles, notes,

and bylines

I'm not sure I have ever seen that output in actual use but somebody must.

Trusted Advisor
Posts: 1,059

Re: Multiple title using CSVALL

I had to work with something like this recently...it was a NIGHTMARE!!

Please reconsider your approach.

Tom

Valued Guide
Posts: 2,174

Re: Multiple title using CSVALL

This sounds like writing multiple "reports" to a single ODS destination before the

Ods {destination} close ;

In my non-ODS mind, I would treat it to my usual approach (now embedded in a macro (simplecsv) - called multiple times before the file is "closed".

OK, not quite

As my simplecsv approach uses 2 data steps to write one file (headers in data step1 and data in second)  with the FILE statement option MOD only on the second, for this problem I might extend the macro with a new parameter - default would be REPLACE. Then when not REPLACE use MOD on the first file statement

Esteemed Advisor
Esteemed Advisor
Posts: 7,232

Re: Multiple title using CSVALL

This isn't a CSV if you are putting titles/footnotes, and the concept of pages in.  Whilst there is no standard, the given form is:

https://www.ietf.org/rfc/rfc4180.txt

What is the purpose of the file?  Transfer, then use plain CSV, just one row of variable names, then the data.  Or XML, which will allow you more options on describing the output data.  Or just use a dataset/XPT file. 

If its for a report, then consider one of the report file formats, PDF for example.  If someone really insists on using Excel (which I assume is the real question behind this question), first try to stop them using Excel, and if they still insist then use ods tagsets.excelxp.

Ask a Question
Discussion stats
  • 6 replies
  • 250 views
  • 0 likes
  • 6 in conversation