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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.