@mdoddala wrote:
But the Id in input statement overrides the 3 bytes in the length statement with 8 bytes
SAS will define the variable as soon as it has to. Variables will only be defined by how they are used in an INPUT statement if they have not already been defined. Since ID was defined already as length $3 by the LENGTH statement the INPUT statement does not change that.
Don't get confused by the ability to add a bare $ modifier in an INPUT statement. That is only needed if you have not previously defined the variable as character. The bare $ modifier is just for convenience when you haven't previously defined the variable and you don't want the INPUT statement's reference to the variable to cause it to be created as numeric. So if the first reference to the variable is the INPUT statement you need to add the $ (or include a character informat) or SAS will define the variable as numeric.
Thanks for the clarification:)
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: