achment 1.1.5  Read File 5 (SIG codes)of IBES data

* read code file (File 5) of IBES data ;

options ls=72 ps=57 ; * obs = 100000 ;

proc format ;
        value $periodf
                0 = 'LTG  '
                1 = 'FY 1 '
                2 = 'FY 2 '
                3 = 'FY 3 '
                4 = 'FY 4 '
                5 = 'FY 5 '
                6 = 'Qtr1 '
                7 = 'Qtr2 '
                8 = 'Qtr3 '
                9 = 'Qtr4 '
                A = 'Semi1'
                B = 'Semi2'
                C = 'Semi3'
                D = 'Semi4'
                ;
data ;
        array   estis {5} estimed estimean estistdv estihigh estilow ;
        infile '/u82/IBES/IBESSUM/5SIG9608' ;
        file   '/u51/business/gcao/IBES/data_files/5SIG9608.raw' ;
        if _n_ = 1 then do ;
                put 'load data' ;
                put 'infile *' ;
                put 'into table sig' ;
                put 'fields terminated by '','' ' ;
                put     '(' ;
                put     'sigcode,';
                put     'sectabrv,';
                put     'sectname,';
                put     'induabrv,';
                put     'induname,';
                put     'grupabrv,';
                put     'grupname,';
                put     ')' ;
                put     'begindata' ;
                end ;
        input   sigcode    1-6
                sectabrv  $ 7-14
                sectname  $ 15-38
                induabrv  $ 39-46
                induname  $ 47-70
                grupabrv  $ 71-78
                grupname  $ 79-102
        ;
        if foreendm = 0 then foreendm = . ;
        do i=1 to 5 ;
                if estis{i} = -99999 then estis{i} = . ;
                estis{i} = estis{i}/(10**deciloca) ;
                end ;
        put     sigcode','
                sectabrv','
                sectname','
                induabrv','
                induname','
                grupabrv','
                grupname','
        ;
run ;
/* for future possible use*********************

proc print ;
        title  'IBES Data' ;
        title3 'SIG CODES' ;
        title5 'All the observations' ;
        var     sigcode
                sectabrv
                sectname
                induabrv
                induname
                grupabrv
                grupname
        ;
        format foreperi $periodf. ;
run ;
********************************************/


This page hosted by Get your own Free Home Page