05-17-2017 01:33 AM
I'm a new user and your assistance would be very much appreciated.
I'm a trying to calculate CEOs social connections using data from BoadEx specifically CEOs educational networks, past employment networks and other activities networks. However, the codes I have tried so far don't work.
Is there any available codes in SAS to estimate these social networks measures of individuals in boadex database?
Thank you very much for the assistance.
05-17-2017 05:23 AM
BoardEx database (http://corp.boardex.com/data/), contains biographical information on the senior executives and board members of public and private firms. For each director or executive, BoardEx compiles a full historical profile containing the past employment history, current employment, board memberships, educational background, and social activities such as memberships in social and charitable organizations.
I want to measure a CEO network size by counting the number of executives or directors on the annual network with whom the CEO has connections. I define a CEO network connection as one established between a CEO and another individual if they link on one or more of employment, education, or other activities (e.g., social club). For instance,two individuals are connected via employment if their careers overlap with the same employer in the same year.
Sample of data attached.
Thanks for the assistance.
05-17-2017 06:51 AM
05-18-2017 05:51 AM
Thanks for the guidelines
Please attached is a sample of directors/individuals educational background from the entire sample. I want to estimate the educational connections among individuals. Thus when two individuals are connected through educational networks if they graduated within a year from the same university and have the same degree type.
Thanks for the assistance.
05-18-2017 06:51 AM
Please read my post again, carefully. Excel files are useless as example data, for a lot of reasons. Please post your data in a datastep, as described in the link I gave you.
05-25-2017 07:09 AM
I have tried several times to put my data in a datastep as directed but still not working for me.
Any further directions for me...Am still trying to find my way as a new user.
05-25-2017 07:46 AM
Where did you fail?
- downloading the zip?
- extracting the .sas from the zip?
- opening the .sas in your SAS environment?
- running the macro as documented?
- finding and loading the resulting .sas file?
05-27-2017 12:45 AM
Please KurtBremer thank you very much.
However, when i copy the macro and run after making the neccessary changes. Please this the error i keep getting.
I have no clue how to fix this problem after several trials of fixing it. Thanks once again for the further direction
817 %macro data2datastep(edu,networks,,5);
ERROR: Invalid macro parameter name ,. It should be a valid SAS identifier no longer than 32
ERROR: A dummy macro will be compiled.
818 %local varlist msgtype;
820 %if %superq(obs)= %then %let obs=MAX;
822 %let msgtype=NOTE;
823 %if %superq(dsn)= %then %do;
824 %let msgtype=ERROR;
825 %put &msgtype: You must specify a data set name;
827 %goto syntax;
829 %let dsn=%qupcase(%superq(dsn));
830 %if %superq(dsn)=!HELP %then %do;
832 %put &msgtype: &SYSMACRONAME macro help document:;
833 %put &msgtype- Purpose: Converts a data set to a SAS DATA step.;
834 %put &msgtype- Syntax: %nrstr(%%)&SYSMACRONAME(dsn<,lib,file,obs>);
835 %put &msgtype- dsn: Name of the dataset to be converted. Required.;
836 %put &msgtype- lib: LIBREF where the dataset resides. Optional.;
837 %put &msgtype- file: Fully qulaified filename for the DATA step produced. Optional.;
838 %put &msgtype- Default is %nrstr(create_&lib._&dsn._data.sas) in the SAS default
839 %put &msgtype- obs: Max observations to include the created dataset. Optional.;
840 %put &msgtype- Default is MAX (all observations);
842 %put NOTE: &SYSMACRONAME cannot be used in-line - it generates code.;
843 %put NOTE- Use !HELP to print these notes.;
847 %if %superq(lib)= %then %do;
848 %let lib=%qscan(%superq(dsn),1,.);
849 %if %superq(lib) = %superq(dsn) %then %let lib=WORK;
850 %else %let dsn=%qscan(&dsn,2,.);
852 %let lib=%qupcase(%superq(lib));
853 %let dsn=%qupcase(%superq(dsn));
855 %if %sysfunc(exist(&lib..&dsn)) ne 1 %then %do;
856 %put ERROR: (&SYSMACRONAME) - Dataset &lib..&dsn does not exist.;
857 %let msgtype=NOTE;
858 %GoTo syntax;
861 %if %superq(file)= %then %do;
862 %let file=create_&lib._&dsn._data.sas;
863 %if %symexist(USERDIR) %then %let file=&userdir/&file;
866 %if %symexist(USERDIR) %then %do;
867 %if %qscan(%superq(file),-1,/\)=%superq(file) %then
868 %let file=&userdir/&file;
871 proc sql noprint;
872 select Name
873 into :varlist separated by ' '
874 from dictionary.columns
875 where libname="&lib"
876 and memname="&dsn"
878 select case type
879 when 'num' then
881 when missing(format) then cats(Name,':32.')
882 else cats(Name,':',format)
884 else cats(Name,':$',length,'.')
886 into :inputlist separated by ' '
887 from dictionary.columns
888 where libname="&lib"
889 and memname="&dsn"
893 data _null_;
894 file "&file" dsd;
895 if _n_ =1 then do;
896 put "data &lib..&dsn;";
897 put @3 "infile datalines dsd truncover;";
898 put @3 "input %superq(inputlist);";
899 put "datalines4;";
901 set &lib..&dsn(obs=&obs) end=last;
902 put &varlist @;
903 if last then do;
905 put ';;;;';
907 else put;
05-27-2017 03:03 AM
Everything from %macro to %mend is the macro definition and must not be altered.
You then call the macro with %data2datastep(edu,networks,,5)
05-28-2017 03:24 PM