What is the meaning of +2 in below code ?
What will be the impact on output ?
data abc;
input Type $ 1-5 + 2 Color $;
datalines;
daisyyellow
;
run;
Having just read columns 1 through 5 to get a value for TYPE, SAS is now positioned to look for the next variable starting at column 6. The "+2" tells SAS to move two columns to the right, so it will start looking for a value for COLOR at column 8.
It means that there are 2 ignored characters to the right of position 5 (the end of variable Type) before variable color is read.
What is the impact on the output? Some things are left for the user to figure out. A simple way to figure out what the impact on the output will be is to actually run the code.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.