BookmarkSubscribeRSS Feed
kajal_30
Quartz | Level 8

code showing error on base sas

kajal_30
Quartz | Level 8
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
Patrick
Opal | Level 21

@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.

 

@Reeza , @ChrisNZ 

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.

 

Kurt_Bremser
Super User

@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.

Kurt_Bremser
Super User

@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.

ChrisNZ
Tourmaline | Level 20

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.

 

 

ChrisNZ
Tourmaline | Level 20

@kajal_30 

 

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?)

 

 

 

ChrisNZ
Tourmaline | Level 20

> 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 ?

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 22 replies
  • 1839 views
  • 5 likes
  • 6 in conversation