code showing error on base sas
@kajal_30 wrote:
Can I get a contact number or we can do a zoom meeting to quickly discuss this ? I can provide all info on the fly
That's not how the SAS Support forums work. You can try and call SAS TechSupport though - or if you're in the US/Canada use the chat tool.
It looks like @Tom has the answer to the 18000000 mystery given here:
So to convert 7 digit mainframe dates of the form cYYMMDD, where c=1 means 1900, to normal 8 digit dates of the form CCYYMMDD you need to add 18,000,000.
@kajal_30 wrote:
Can I get a contact number or we can do a zoom meeting to quickly discuss this ? I can provide all info on the fly
Post ALL relevant information here. Describe IN FULL what you want to do. Provide source data in usable form (data step with datalines), and what you want to get out of it.
@kajal_30 wrote:
The code I am running is a main frame code which I am trying to convert to a base sas
So it is positively not code that "ran fine for 10 years", not in the current environment. Do not force us to pull information out of your nose bit by bit.
Ok this makes sense now.
The data can only be like this:
data HAVE;
*Format cYYMMDD - c= century number: 0 for 1800, 1 for 1900, 2 for 2000 ;
DATE = 1990401 ;
DATEZ = input(put(18000000+DATE,z8.),yymmdd8.);
format DATEZ date9.;
run;
> But in that case why does it have the INFORMAT of DATE attached to it?
Probably some awkward attempt to "improve" the data.
If you have errors, it means that the value of DATE is not as above ( DATE = 1990401 in my example).
1. Look at your data.
2. Show us the log (how many people have asked you?)
> I have a data set where date = 30apr2020
is meaningless.
Is variable DATE a numeric variable?
Tell us what you want to do. Why add 18000000 ?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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: