BookmarkSubscribeRSS Feed
ghosh
Barite | Level 11

This structure is quite simple to replicate with a proc report inside an ods excel structure. imcluding multisheet reports.  You can also create any printer ourtput such as html, pdf, etc.

You could strart with this link, and also read up on the papers available on this topic on the SAS Global Forum

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p09n5pw9ol0897n1qe04zeur27rv.htm#n0bmw0...

Do have a specific requirement?

 

 

Anto180788
Calcite | Level 5

Anto180788_1-1657621941524.png

 

Good morning everyone,

many thanks for all advice.

My boss said me that the problem is to replicate cell unified (yellow area) in SAS.

Is there anyway to do that?

 

Secondo question, Is it possibile to use a structure of table and just put inside a dataset?

Thank you very much

Kurt_Bremser
Super User

@Anto180788 wrote:

Anto180788_1-1657621941524.png

 

Good morning everyone,

many thanks for all advice.

My boss said me that the problem is to replicate cell unified (yellow area) in SAS.

Is there anyway to do that?


PROC REPORT can set background colors for each column, and you can also (in a COMPUTE block) set attributes (including the background) for a single report item depending on position or content.

 


Secondo question, Is it possibile to use a structure of table and just put inside a dataset?


Please explain what you mean by that.

SAS provides metadata in the SQL DICTIONARY tables, so you can retrieve that from there.

If, OTOH, you want to create the structure in a dataset without having actual data, you can do it like this:

data class;
set sashelp.class;
stop;
run;

The resulting dataset will have all columns from SASHELP.CLASS, but zero observations.

Anto180788
Calcite | Level 5
Hi Kurt,
thank you for your answer.
1) In proc report, can you create exactly a column with a space as in example?
2) I mean, I want use that table strucutre (initially empty) and put data inside. As an insert in sql.
Tom
Super User Tom
Super User

@Anto180788 wrote:
Hi Kurt,
thank you for your answer.
1) In proc report, can you create exactly a column with a space as in example?
2) I mean, I want use that table strucutre (initially empty) and put data inside. As an insert in sql.

No.  You are still confusing the REPORT that you want to create in the Excel file and the DATA that you will need to create it.

Anto180788
Calcite | Level 5
Hi Tom,

I'm not confusing anything.
I asked two questions:
1) How to create a column as I circled in yellow in the example.
2) If you have a structure of a report like that in the example, is it possibile put inside directly data?
Sajid01
Meteorite | Level 14

Hello @Anto180788 
It is indeed possible to create a table structure / empty table for the columns highlighted in yellow.
As a proof of concept I am giving the code that would create an emtpy table or structure .The variable names, types and size are indicative examples and need to be subsituted with actual values.

Data can be stored in the table so created.  Reports can be produced using the data stored in the table.

/*This portion creates the table*/
Proc sql;
create table work.Empty_table (label="Impact and Substitutability Analysis")
	(
	Market_share	num  length=8 format=best12. label="Market Share",
	Impact_on_market char length=100  label="Impact On Market",
	Substitutability  char length=100   label="Substitutability",
	Critical_function char length=100   label="Critical Function"
	);
quit;
/* This portion gives the details of the table*/
proc contents data=work.empty_ds3;
run;

The operative portion of the output of the content portion are reproduced below :

This shows the structure of the table:

Sajid01_0-1657667861908.png

This extract shows the table label:

Screenshot 2022-07-12 7.18.37 PM.png

 

 

Kurt_Bremser
Super User

@Anto180788 wrote:
Hi Kurt,
thank you for your answer.
1) In proc report, can you create exactly a column with a space as in example?
2) I mean, I want use that table strucutre (initially empty) and put data inside. As an insert in sql.

This is a REPORT. You don't "insert" data into it, you create it from raw data with PROC REPORT.

 

PROC REPORT allows spanning, structured headers.

 

To show you code, we need to see your raw, tabular data.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 22 replies
  • 3081 views
  • 4 likes
  • 6 in conversation