BookmarkSubscribeRSS Feed
Anto180788
Calcite | Level 5

Good Morning everyone,

 

I'm trying to replicate a table structure in SAS as in the example of table structure attached.

I would to know if it is possibile to replicate this structure in SAS and how.

The output expected is the table structure in the example with subtitles, if it possibile.

 

Thank you for all advice.

22 REPLIES 22
andreas_lds
Jade | Level 19

I don't open attachments, but replicating an excel table with sas is almost always a question of how much time one has. With the Report Writing Interface you can do anything, but you will have to code it.

Anto180788
Calcite | Level 5
Good Morning andreas,
I can look the attachment and I have to zoom to see the structure. Let me know if you can't do it.
I have time. So is the Report Writing interface only way to do that?
Have you look the example?
Thanks
andreas_lds
Jade | Level 19

I won't open attachments due to security rules in my company. So i don't know if using an output procedure (report, tabulate) can create the table you want.

Anto180788
Calcite | Level 5
ah ok, don't worry Andreas. Thanks
Sajid01
Meteorite | Level 14

Your excel file is apparently a report generated from some other applications.
It is indeed possible to produce similar reports using proc tabulate or proc report and combine ods excel destination.
The look and file will largely be identical but may not necessaril be exactly the same.

Anto180788
Calcite | Level 5
Hi Sajid,
thanks to reply me.
The point is to replicate the structure of table. In particular, I need to replicate row and columns structure(with specific spaces). So do you think is it possibile with proc tabulate and proc report?
Thanks
Kurt_Bremser
Super User

Don't expect a 1:1 copy of the look, but you can (almost) always create the same logical structure. To give you hints how to do it, we need to have usable source data (SAS dataset, posted as a data step with datalines) and the logic for calculating and/or setting the values in the report.

Anto180788
Calcite | Level 5
Hi Kurt,
For now, I need only replicate only the structure.
I haven't the data yet. As you can understand, this is a structure of a template. It is a final step of a elaboration process.
Sajid01
Meteorite | Level 14
If your intention is to create a dataset with same structure as in the excel file, I am afraid, no. There is no easy way to do it.
You can , however, import the excel file and its content will constitute the data of the dataset.
Anto180788
Calcite | Level 5
That is my intention.
The excel fle is an output of a process. So importing back it is useless.
Kurt_Bremser
Super User

To get from A to B, one needs to know both A and B.

So for providing examples of code to create the report (B), we need to know the structure of the source data (A); without it, there's nothing to suggest, except "PROC REPORT might do it" or something similar vague.

Anto180788
Calcite | Level 5
The excel file is an output.
So, do you want to know what are datatasets in input?
Thanks
Kurt_Bremser
Super User

The Excel spreadsheet you show us is clearly a report, and not a dataset or a database table. If you created it from SAS datasets, you already have everything you need.

 

Datasets or tables in databases have consistent types for columns and only one set of names for the columns.

 

In SAS, if you want to store such a report, you store the underlying dataset(s) and the SAS program, so you can recreate the report anytime by rerunning the program.

 

Sajid01
Meteorite | Level 14

Thanks @Anto180788 for offering to post the datasets.
However the report is the outcome of a series of steps.
One needs to know the process ( BRD- Business Requirement Document) and the data to write the proper and relevant code.
The following is a good introduction to SAS Proc Report procedure and give a fairly good idea about what can be accomplished http://www.scsug.org/wp-content/uploads/2017/10/An-Introduction-to-PROC-REPORT-SCSUG-2017.pdf

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 2118 views
  • 4 likes
  • 6 in conversation