Presentation is loading. Please wait.

Presentation is loading. Please wait.

TASS Meeting using inputn to re-format data September 25 th, 2009 using inputn to re-format data Dr. Arthur Tabachneck Director, Data Management Note:

Similar presentations


Presentation on theme: "TASS Meeting using inputn to re-format data September 25 th, 2009 using inputn to re-format data Dr. Arthur Tabachneck Director, Data Management Note:"— Presentation transcript:

1 TASS Meeting using inputn to re-format data September 25 th, 2009 using inputn to re-format data Dr. Arthur Tabachneck Director, Data Management Note: stolen from a sas-l post by Ian Whitlock

2 TASS Meeting using inputn to re-format data September 25 th, 2009 suppose you had the following data: data have; input info $30.; cards ; 65 04/15/45 04/15/1946 15/04/47 15/04/1948 15APR1949 1950 ;

3 TASS Meeting using inputn to re-format data September 25 th, 2009 and you needed to have the following file: data need; input age; cards ; 65 64 63 62 61 60 59 ;

4 TASS Meeting using inputn to re-format data September 25 th, 2009 a data step solution data need; set have; if length(info) le 3 then age = inputn ( info, 'f', 8 ) ; else if length(info) eq 4 then age= year(today())- inputn ( info, 'f', 8 ) ; else age= round(yrdif( inputn (info, 'anydtdte', length(info) ), today(),'Actual')); run ;

5 TASS Meeting using inputn to re-format data September 25 th, 2009 inputn Enables you to specify a numeric informat at run time Syntax: INPUTN(source, informat. >)

6 TASS Meeting using inputn to re-format data September 25 th, 2009 Questions? Your comments and questions are valued and encouraged. Contact the author: Dr. Arthur Tabachneck Director, Data Management Insurance Bureau of Canada Toronto, Ontario L3T 5K9 Email: atabachneck@ibc.ca


Download ppt "TASS Meeting using inputn to re-format data September 25 th, 2009 using inputn to re-format data Dr. Arthur Tabachneck Director, Data Management Note:"

Similar presentations


Ads by Google