hi guys,
i am supposed to write these four var to an output file and my id must be a char variable starting from position 111 ending position 125
but they get left justified ,probably cuz they are numeric . is there a way i can move them to start from position 111 without beeing converted to char var?
put @001 fname 25.
@026 lname 25.
@051 email 60.
@111 id 15.
Try 25.-L as format (-L left aligns, -C Centers, -R right aligns)
Try this:
put @001 fname $25.
@026 lname $25.
@051 email $60.
@111 id Z15. ;
Try 25.-L as format (-L left aligns, -C Centers, -R right aligns)
sorry i dont understand what you mean
PUT @1 fname
...
@111 id 15.-L
;
sorry about the 25. - I thought id was the first variable
In your question you state id gets left aligned, but I'm assuming you misstated that - I think you meant right aligned.
This will left align id starting at column 111.
If you wanted to center the value, use -C, if you want to right align(default for numeric variables), use -R
Look in online manual under PUT formatted for explanation and other examples.
yes i meant right aligned,sorry
but see,i did not know about this L,R and C. Very handy.
Thanks a lot!
Ahh ... but I did - that's what makes these communities so handy. Learn something new every day. And I've been doing this about 30 years.
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.