Hello, in screen shot you can see that a value under "sex" column is missing, I have no idea what happened here, only I know is that "10240" is causing it. How to manage with that? I would like to get "10240" value under "type" column, and value "1" under "sex" column, the rest of rows should not change.
There is nothing in column 6 on the first line so SEX is read as missing.
You can fix the line by removing the space in column 5 and then SEX and the following values will be read right. But you would need to read TYPE from column one thru five instead of one thru four.
Since your data is separated by spaces just use list mode input instead of column mode.
If you do have any missing values on a line then use a period to represent them so the list mode sees at least something to read for that field in the line and does get out of sync. Use a period for either numeric or character variables. The normal informat for character variables will translate a single period into blank (missing) value.
There is nothing in column 6 on the first line so SEX is read as missing.
You can fix the line by removing the space in column 5 and then SEX and the following values will be read right. But you would need to read TYPE from column one thru five instead of one thru four.
Since your data is separated by spaces just use list mode input instead of column mode.
If you do have any missing values on a line then use a period to represent them so the list mode sees at least something to read for that field in the line and does get out of sync. Use a period for either numeric or character variables. The normal informat for character variables will translate a single period into blank (missing) value.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.