BookmarkSubscribeRSS Feed
merahilyana
Fluorite | Level 6

i need help??

 

example my value is:

state

kula lumpur

puterajaya

labuan

 

but i want it will be like this:

state

  kula lumpur

      puterajaya

  labuan

8 REPLIES 8
PeterClemmensen
Tourmaline | Level 20

What is the logic here?

merahilyana
Fluorite | Level 6
i want put space before kula lumpur n more space before puterajaya..that all
PeterClemmensen
Tourmaline | Level 20

Why? You just want to put for example two spaces before kula lumpur and four spaces before puterajaya.

merahilyana
Fluorite | Level 6

THAT IS EXAMPLE THE REAL DATA LIKE THIS:
BATU PAHAT
  M.P. Batu Pahat
    Bandar Penggaram

to show result at word like that..

Kurt_Bremser
Super User

What do you mean by "real data"? SAS datasets or external files from which SAS data needs to be created?

Also keep in mind that in many cases, SAS will not display leading blanks per default.

merahilyana
Fluorite | Level 6
MY DATA..NOT FROM SAS..JUST WANT APPEAR RESULT WILL BE LIKE THAT ONLY..
Astounding
PROC Star

If that data is already in a SAS data set, you need to take two steps.

 

First, add leading blanks.  For example:

 

varname = '  ' || varname;

 

Secondly, you need to preserve the leading blanks when displaying the variable.  For example:

 

format varname $char20.;

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!
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
  • 8 replies
  • 1395 views
  • 2 likes
  • 4 in conversation