View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
In SAS is there a way where we can replace the leading zeroes with Spaces ??
thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Leading zeroes in what? Output just requires a w.d format -- other situations depends on what you're wanting. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
To my SAS program, I have a input field which has value of
00000000012
I am writing this feild to my output file.
I need to write the above field as 12, instead of 00000000012.
Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What is the input statement for the variable look like? What does your output statement look like? Generally if you just say
it will come out right justified, left blank filled -- standard numeric variable processing.
If it is a character variable, you can do
Code: |
NUMVAR = INPUT (VAR,11.); |
and output NUMVAR instead of VAR. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
My input variable is defined as below
I am writing it as
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
POL_NUM_INT = INPUT(POL_NUM,16.) ;
@1 POL_NUM_INT 11. |
should get it. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
When I do as shown below
Input defination:
Code: |
POL_NUM_INT = INPUT(POL_NUM,16.0); |
output write :
My output is
What I need is
it should be right justified and not left justified.
Can someone pls advise ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
it should be right justified and not left justified.
Can someone pls advise ? |
Suggest you look at the prior replies - this answer was given earlier.
Quote: |
it will come out right justified, left blank filled -- standard numeric variable processing. |
|
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
My apologies.. I implemented as suggested and it worked for me.
Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear it's working. |
|
Back to top |
|
|
|