This macro seems to work fine except that my defined vars (school, dob and recnum) are all blank when I open data set ONE in the work library. However, when I submit the PROC PRINT DATA=ONE statement all of those defined vars show up in the output as I expect. Vars in question are colored red.
code:
You NEED to format that code to make it legible...if we can't read it, it's harder to debug.
It's also not clear what your issue is.
You NEED to format that code to make it legible...if we can't read it, it's harder to debug.
It's also not clear what your issue is.
The network drive just went down so that's all of the fun for today.
My issue is that the variables dob, school and recnum are missing for all observations when I open "one" in work.library. When I submit PROC PRINT DATA=ONE the values for dob, school and recnum are there.
I need these variables in a subsequent step in order to do some matching.
Are you sure they're missing for all, or just the first few records?
Are all the text files in the same folder and are you importing all files in that folder?
It may help to show the LOG for the macro reading the data with options mprint; set. Paste the code and any messages into a codebox using the forum {i} menu icon to preserve formatting.
Show some values of DOBCHAR where the DOB is missing. (Probably wouldn't hurt to provide a format for DOB like date9 or mmddyy10)
@GreggB wrote:
My issue is that the variables dob, school and recnum are missing for all observations when I open "one" in work.library. When I submit PROC PRINT DATA=ONE the values for dob, school and recnum are there.
I need these variables in a subsequent step in order to do some matching.
How do you "open "one" in work.library"? Perhaps you just aren't scrolling far enough to the right to see the columns?
This was much ado about nothing on my part. I deleted @1 line $char2601.; from the INPUT statement. I think the length of it was obstructing my view of the vars in question.
How could the code to create SCHOOL possibly have worked fine? The formula expresses a character variable (SCHCODE) using a numeric format (ACTFMT.)?
We'll need to see the log, and possibly a few examples of data values.
"fine" was the wrong word. It ran without errors. I'm correcting the schcode format issue.
This was much ado about nothing on my part. I deleted @1 line $char2601.; from the INPUT statement. I think the length of it was obstructing my view of the vars in question.
Looking at this statements....
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 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.