SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How to format SQL fields to SAS SI 3.4 fields

Reply
Contributor SYN
Contributor
Posts: 39

How to format SQL fields to SAS SI 3.4 fields

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.

Contributor SYN
Contributor
Posts: 39

Re: How to format SQL fields to SAS SI 3.4 fields

How to format SQL fields to SAS DI 3.4 fields

Super Contributor
Posts: 349

Re: How to format SQL fields to SAS SI 3.4 fields

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

Contributor SYN
Contributor
Posts: 39

Re: How to format SQL fields to SAS SI 3.4 fields

Shiva thank you. What you said is correct.

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

Please help me.

Respected Advisor
Posts: 3,889

Re: How to format SQL fields to SAS SI 3.4 fields

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

Ask a Question
Discussion stats
  • 4 replies
  • 310 views
  • 0 likes
  • 3 in conversation