Help using Base SAS procedures

How to right justify text using put statement

Accepted Solution Solved
Reply
Super Contributor
Posts: 400
Accepted Solution

How to right justify text using put statement

I have a report i'm creating that displays columns that have decimal data that is not even in length.

For example

11.1111

2222.2222

3.3333

I want to know how I can have it display where it right justifies the data

    11.1111

2222.2222

     3.3333

I tried using formats which helped in some other scenarios but not this one.

I'm currently just doing a put @1 decData

I'm sending this to a text file using a filename statement.

Any help would be greatly appreciated.


Accepted Solutions
Solution
‎09-28-2011 12:35 PM
PROC Star
Posts: 7,492

Re: How to right justify text using put statement

Posted in reply to jerry898969

Jerry,

When I used it I ended up with a file that looked as follows:

    11.1111

  2222.2222

     3.3333

View solution in original post


All Replies
PROC Star
Posts: 7,492

How to right justify text using put statement

Posted in reply to jerry898969

How about:   put @1 decData 10.4;

Super Contributor
Posts: 400

How to right justify text using put statement

Art,


Thank you for your reply.

I tried using that format and it still doesn't line up. 

I looking at maybe using the z format and have it fill the difference with zeros.

Solution
‎09-28-2011 12:35 PM
PROC Star
Posts: 7,492

Re: How to right justify text using put statement

Posted in reply to jerry898969

Jerry,

When I used it I ended up with a file that looked as follows:

    11.1111

  2222.2222

     3.3333

Super Contributor
Posts: 358

Re: How to right justify text using put statement

He might be using a proportional font to view the ouput - this may cause the results to not line up visually.  See what happens when you use a fixed pitch font.

Super Contributor
Posts: 400

How to right justify text using put statement

Art,

I tried it again and it did work like I need it too.

Thank you

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 307 views
  • 0 likes
  • 3 in conversation