Hi guys,
I have got a txt file and it has got some dates in it in the following format (ddmmyy8.):
12/12/71
but when I try to read in using below data step it does not read in and it inserts period (.) instead of date (this happens when I try to read it in as a numeric) but it reads fine as a character.
Is it possible to readin dates?
Data work.line;
infile "c:\temp\upload.txt";
input id 1-5 lineno 7-9 emp 11-19 dob $ 21-28
fname $ 30-88 type 90-92 comp_id 94-98
valid 101-105 product $ 107 absind $ 109
ptake $ 111-115 tot 117-119 est $ 121-123
desig $ 125-127 sigs $ 129-131 prdevid $ 133
prdscrip $ 135 prdfeed $ 137 prd_status 139-141
date_stocked $ 143-150 lockstat 152-154
date_stamp $ 156-174;
run;
text file:
12345,123,123456789,26/12/71,My Name is Saqi The Angel I work for Harvard College of Com,123,456789,12345,N,Y,Mondy,100,Yes,Tes,Nop,M,N,O,444,26/12/71,999, 11NOV02:13:56:05
Thanks
Saqi Knowledge is something no one can steal from you and it increase as time goes by. Saqi
I have got a txt file and it has got some dates in it in the following format (ddmmyy8.):
12/12/71
but when I try to read in using below data step it does not read in and it inserts period (.) instead of date (this happens when I try to read it in as a numeric) but it reads fine as a character.
Is it possible to readin dates?
Data work.line;
infile "c:\temp\upload.txt";
input id 1-5 lineno 7-9 emp 11-19 dob $ 21-28
fname $ 30-88 type 90-92 comp_id 94-98
valid 101-105 product $ 107 absind $ 109
ptake $ 111-115 tot 117-119 est $ 121-123
desig $ 125-127 sigs $ 129-131 prdevid $ 133
prdscrip $ 135 prdfeed $ 137 prd_status 139-141
date_stocked $ 143-150 lockstat 152-154
date_stamp $ 156-174;
run;
text file:
12345,123,123456789,26/12/71,My Name is Saqi The Angel I work for Harvard College of Com,123,456789,12345,N,Y,Mondy,100,Yes,Tes,Nop,M,N,O,444,26/12/71,999, 11NOV02:13:56:05
Thanks
Saqi Knowledge is something no one can steal from you and it increase as time goes by. Saqi