BookmarkSubscribeRSS Feed
SYN
Obsidian | Level 7 SYN
Obsidian | Level 7

I am getting the data from .CSV files.

Getting all the data in character format.

Can you please help to format the below datatypes to SAS data types.

FieldVarchar(20)DD/MM/YYYY
FieldDateTimeCall Start Time
FieldDateTimeCall End Time
FieldText
Fieldint
Fieldnumeric(9,2)
Fieldnumeric(9,2)
Fieldnumeric(9,0)
FieldNumeric(15,0)
FieldNumeric(15,0)
FieldDecimal (17,2)
FieldDecilmal(10,2)
FieldDecimal(10,2)
FieldBigInt

It will be great help. Thanks in advance.

Sreenivasa
4 REPLIES 4
SYN
Obsidian | Level 7 SYN
Obsidian | Level 7

How to format SQL fields to SAS DI 3.4 fields

Sreenivasa
shivas
Pyrite | Level 9

Hi,

When importing/creating the .csv files you can change to what ever (format/length/type/in format/name) you want.Check the Screen shot below.

Thanks,

Shivaimport.png

SYN
Obsidian | Level 7 SYN
Obsidian | Level 7

Shiva thank you. What you said is correct.

But I need what is the equalent SAS format for the above fields.

Please help me.

Sreenivasa
Patrick
Opal | Level 21

When reading data from textile into a SAS table you need to use the correct INFORMAT so that SAS converts the strings as required. Especially for date and date time values you also need to apply appropriate formats so that the values are "human readable" when looking at them.

This is very basic stuff and you must understand how this works. It's documented in the Base SAS Language and the Concepts manual. You need to read it.

You also need to understand how SAS stores date and date time values and what variable types SAS uses. It's all in the concepts manual (online available).

Below links should help as well:

[http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001405621.htm

[http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a003209899.htm

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1157 views
  • 0 likes
  • 3 in conversation