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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.