proc sql;
create table countries (name char(25), Capital char(25), Population num(45), Area num(35),
Contant char(25), UNDate num informat=year4. format=year4. );
insert into countries values('Afghanistan','Kabul',17070323,251825,'Asia',1946);
quit;
In the above insert UNDate value 1946 problem output it gives 1965
On top of what @Kurt_Bremser said:
Informats on a table don't come into play when using a SQL insert statement. You need already to provide in the insert statement the value that matches the data type.
Informats come into play when using an INPUT statement.
Code below that uses a valid informat to demonstrate what I just wrote.
proc sql;
create table countries (
name char(25),
Capital char(25),
Population num(45),
Area num(35),
Contant char(25),
UNDate num informat=date9.
);
insert into countries values('Afghanistan','Kabul',17070323,251825,'Asia','10Mar2023');
quit;
On top of what @Kurt_Bremser said:
Informats on a table don't come into play when using a SQL insert statement. You need already to provide in the insert statement the value that matches the data type.
Informats come into play when using an INPUT statement.
Code below that uses a valid informat to demonstrate what I just wrote.
proc sql;
create table countries (
name char(25),
Capital char(25),
Population num(45),
Area num(35),
Contant char(25),
UNDate num informat=date9.
);
insert into countries values('Afghanistan','Kabul',17070323,251825,'Asia','10Mar2023');
quit;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.