[程式] SAS資料處理問題請教

看板Statistics作者 (曼蒂)時間9年前 (2016/10/20 23:48), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
[軟體程式類別]:SAS [程式問題]:資料處理 [軟體熟悉度]:新手 [問題敘述]: 這是題目 What is the SAS code to read the csv file located in 'H:\AMS2640\Ex3\SA_Profil e.csv' into SAS as 'Ex3.SA_Profile' such that (1) Date and Time can be read as numerical values correctly and (2) DSE Core 5 score including Math M1/M2 will be computed and stored as DSE_Core_5? 資料截圖 http://i.imgur.com/V5ATXOI.jpg
老師給的提示 http://i.imgur.com/b5HPSv6.jpg
問題一: 老師說要從第二行開始讀取 是使用老師提示中dsd firstobs這個語法嗎? 但我在後面加了上去: infile 'C:\AMS2640\Ex3\SA_Profile.csv' dlm=',' dsd firstobs=2; 之後讀出來的檔案並沒有任何改變, 請問是哪邊出了問題呢? 問題二: 日期與時間要換成時間變數, 請問該怎麼寫呢? 在網上搜尋了非常多資料可是怎麼試都沒有改變成功QQ 另外,日期有兩種格式, 2015/7/18以前的資料(1~3305筆資料)是用18-JUL-15這種格式, 2015/7/20以後的資料(3306~4257筆資料)是用DDMMYY10 [程式範例]: libname Ex3 "C:\AMS2640\Ex3"; data Ex3.SA_Profile; infile 'C:\AMS2640\Ex3\SA_Profile.csv' dlm=',' dsd firstobs=2; input Application_Type $ Applicant_ID $ Application_Date $ Application_Time $ ; run; 寫到這裡就再也動不了了 麻煩各位了 謝謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 124.217.188.232 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1476978488.A.163.html

10/21 00:00, , 1F
日期格式可用 input(date,yymmdd10.);去轉換
10/21 00:00, 1F

10/21 01:01, , 2F
我現在成功轉換了時間跟日期的上半部了,但是不知道
10/21 01:01, 2F

10/21 01:01, , 3F
怎麼轉換剩下的部分~謝謝
10/21 01:01, 3F
文章代碼(AID): #1O2ESu5Z (Statistics)