BookmarkSubscribeRSS Feed
Gauri123-56
Fluorite | Level 6
I'm new to sas programming don't know how to create tables. Actually I want to create table of adverse events like the format attached below
6 REPLIES 6
Kurt_Bremser
Super User

We need to see the source data; please provide an example, in text form, ideally as a data step with datalines, and also an example for the expected report.

Post SAS code by using the "little running man" button; for other structured text (e.g. logs), use the </> button.

Patrick
Opal | Level 21

@Gauri123-56 What your pdf shows is not a table but a report. 

You will first need to do some training before you are able to produce such a report.

 

Google: What is a SAS table

Patrick_0-1675241045717.png

 

A report is the presentation/printing of the data stored in a table in some tabular form.

Looking at your pdf the most likely SAS procedure to use is Proc Report. You would also need to format your data so it presents/prints the way you want it to.

Unlike your subject line suggests there is no SAS Macro language required for such a report. Don't even go there before you're familiar with the SAS data step language and the "foundation" set of SAS procedures like Proc Report.

 

 

Gauri123-56
Fluorite | Level 6
Yes I have this code using proc report but I want to do this using
macros...
Patrick
Opal | Level 21

@Gauri123-56 wrote:
Yes I have this code using proc report but I want to do this using
macros...

SAS macro language is used to dynamically generate SAS language syntax for execution. SAS macro langue is not suited nor meant for report writing. 

Kurt_Bremser
Super User

@Gauri123-56 wrote:
Yes I have this code using proc report but I want to do this using
macros...

Bullshit. Macros are for creating dynamic code, not for creating reports. As others have already suggested, you need to first become deeply familiar with data step programming and the use of essential procedures (SORT, REPORT, MEANS, FREQ, TABULATE, SQL, TRANSPOSE, to name just a few) before you can even think about macro programming.

 

And if you are already at the step where you have working code and want to make it dynamic, you need to show that code, and which parts of it need to be made dynamic, and the information on which the dynamics are based (e.g. a dataset which contains control information).

LinusH
Tourmaline | Level 20

If new to SAS programming, I suggest that you talk a calss (e.g. Programing 1 - free online option is available).

 

https://support.sas.com/edu/schedules.html?crs=PROG1&ctry=SE

 

Data never sleeps

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 921 views
  • 1 like
  • 4 in conversation