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