Questions tagged [informat]
32 questions
7
votes
5 answers
sas informat datetime
Can anyone advise on the appropriate SAS informat to read in a datetime (dd/mm/yyyy hh:mm) ???
eg
data _null_;
informat from_dt datetime????.;
input from_dt ;
put from_dt=;
cards;
01/01/1960 00:00
;run;

Allan Bowe
- 12,306
- 19
- 75
- 124
4
votes
3 answers
SAS: formats/informats/types. Their differences
another question about formats and informats:
formats are using for output (for show me and other user data in tables), so, i don't care about it, if i want read data from tables in programming way, yes?
but what is informat?
i have data step with…

gaussblurinc
- 3,642
- 9
- 35
- 64
3
votes
3 answers
SAS not recognizing date format
I have the following character date format:
"3/1990"
"4/1990"
"5/1990"
...
I tried the following code:
data work.temps;
set indata;
newdate = input(strip(Date), MMYYSw.);
rename newdate = date;
run;
I keep on getting the following error…

Josh
- 3,231
- 8
- 37
- 58
3
votes
1 answer
Formatting HH:MM column when reading data into SAS
I am an R user and SAS beginner trying to read a csv file into SAS. The problem I am facing is with a column called "TIME" which contains time data in the format "hh:mm " for e.g. "12:23 PM". In R it is as simple as as.POSIXct(df$TIME, format =…

vagabond
- 3,526
- 5
- 43
- 76
2
votes
3 answers
SAS Numeric Informat vs Length
I'm trying to determine how SAS is reading the length statement and then the informat statement. I could be misunderstanding, but I'm under the impression that the informat statement for numeric variables worked like this:
informat number 5.;
This…

DukeLuke
- 315
- 6
- 26
2
votes
2 answers
What is the SAS format and informat for "mm/dd/yyyy hh:mm:ss"?
The Question
Please is there a built-in SAS format and informat for datetime in mm/dd/yyyy hh:mm:ss? For example:
06/25/2015 03:02:01 (June 25th 2015, 3 o'clock 2 minute 1 second).
The Background
I am trying to parse a CSV flatfile to a SAS…

Atlas7
- 2,726
- 4
- 27
- 36
1
vote
3 answers
SAS - how can I read in date data?
I am trying to read in some data in date format and the solution is eluding me. Here are four of my tries using the simplest self-contained examples I could devise. (And the site is making me boost my text-to-code ratio in order for this to post, so…

pumphandle
- 83
- 5
1
vote
1 answer
SAS MMYYSw. format but not informat?
According to SAS not recognizing date format,
4 years and 6 months ago, MMYYSw. was unaccepted as SAS informat (but worked, and still works, as SAS format).
Nowadays, when I submit the following SAS piece of code:
DATA _NULL_;
INPUT x :MMYYS7.;…

Joel Charme
- 31
- 6
1
vote
2 answers
Q: SAS: taking data in dd.m.yyyy format from a csv
I need to import data from a csv-file. And I'm able to read everything else but the date. The date format is like dd.m.yyyy format: 6;Tiku;17.1.1967;M;191;
I'm guessing if I need to specify an informat to read it in? I can't figure out which one to…

Juhani Salo
- 11
- 1
1
vote
1 answer
Define date format on the basis of given date in a txt file
I have been provided dates/datetimes in .txt file
For example:
20180422
02122018
2018/04/22
22/04/2018
04-02-2018
2018-04-20 13:05:56
Now, first I do import above .txt file, so it will be in numeric format in sas dataset. For each date I need to…

user1645514
- 37
- 4
1
vote
2 answers
How to read informats data: $1,000.1M to 1000.1
The datasets include a list of numbers:
$1,000.1M
$100.5M
$1,002.3M
$23.4M
$120.3M
I want to read the variable as a numeric in SAS
the result should be:
Money(millions)
1000.1
100.5
1002.3
23.4
120.3
I…

plainter
- 29
- 1
- 5
1
vote
2 answers
The difference between format and length in SAS
I don't understand the difference between "format", "informat" and "length".

bluehaiku
- 11
- 1
- 4
1
vote
1 answer
SAS Date Informat with Milliseconds
I am trying to create a SAS informat for the following date format:
"yyyy-mm-dd hh:ii:ss.SSS UTC", example: "2016-01-14 10:31:01.456 UTC"
I've gotten close using the following format code:
PROC FORMAT;
PICTURE MyDate other='%0Y-%0m-%0d…

Darrrrrren
- 5,968
- 5
- 34
- 51
1
vote
1 answer
SAS use Forrmat to create a new variable
I am thinking a question: How to create a new variable by using informat.
like : we have a informat like that:
proc format ;
invalue $agegrpcd
1 = '<18'
2 = '18 - 29'
3 = '30 - 39'
4 =…

Wayne
- 33
- 1
- 6
1
vote
2 answers
Reading in dates using informats in SAS when raw data is messy
I am essentially trying to read messy data into SAS using informats and having problems. I have column of data of the following form in a raw txt file, say:
RegDate
0
0
16/10/2002
20/11/2003
0
For RegDate, 0 = missing, otherwise the date is…

AP30
- 505
- 7
- 18