BookmarkSubscribeRSS Feed
merahilyana
Fluorite | Level 6

How to get the result table1  be like table2 in sas eg

 

table1:

Capture1.JPG

 

 

table3:

Capture2.JPG

 

 

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

It's really hard to understand how your data is actually structured from this. Please provide data in a clear, usable form (preferably in the form of a data step)

merahilyana
Fluorite | Level 6

WHAT I MEAN IS:

       from this table in result sas EG 

state and

administrative district

Johor

 

 

Batu pahat

 

Muar

 

to get like this table result sas EG

state and

administrative district

Johor

    Batu pahat

    Muar

 

that is different variable name. state: johor and administrative district: batu pahat and muar.

Reeza
Super User

Please post example data if you would like assistance with the code. 

Your images show the variables being in the same column. 

 

Here are instructions on how to provide sample data as a data step:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...


@merahilyana wrote:

WHAT I MEAN IS:

       from this table in result sas EG 

state and

administrative district

Johor

 

 

Batu pahat

 

Muar

 

to get like this table result sas EG

state and

administrative district

Johor

    Batu pahat

    Muar

 

that is different variable name. state: johor and administrative district: batu pahat and muar.


 

 

ballardw
Super User

Do you mean the appearance inside a data set with viewtable or similar tool? Or a report table generated for people to read by a report procedure such as Proc Report, Tabulate or something else?

 

One approach may be multilabel formats for a report such as shown in the attachment examples.

 

 

Reeza
Super User

PROC REPORT with journal style will give you that report.

 


@merahilyana wrote:

How to get the result table1  be like table2 in sas eg

 

table1:

Capture1.JPG

 

 

table3:

Capture2.JPG

 

 


 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 608 views
  • 0 likes
  • 4 in conversation