tag 标签: Macro经管大学堂:名校名师名课

相关帖子

版块 作者 回复/查看 最后发表
[下载]美林:The Investment Clock:Special Report : Making Money from Macro attachment 行业分析报告 BABY3000 2008-10-22 25 15603 xishuluohua 2022-6-6 11:26:20
[推荐]sas的国外论文中一些基本用法(array、macro、sql) attachment 数据分析与数据科学 cjhong111 2008-9-16 48 13908 384390412 2018-1-31 11:40:23
Carpenter's Complete Guide to SAS Macro-坛子里没有的书 attachment 数据分析与数据科学 southlander 2009-6-19 89 25441 TomHsiung 2018-1-7 18:59:14
sas macro language:course notes attachment 数据分析与数据科学 bioman82 2007-5-6 39 10708 会徽 2017-6-12 14:03:37
[下载]SAS Macro Programming Made Easy, Second Edition[附随书code] attachment 数据分析与数据科学 alexleeliyichon 2008-7-8 23 10246 tzyyjiann12@hot 2016-1-31 15:30:13
[推荐]SAS Macro Programming Made Easy (2nd.Edition, 2007) attachment 数据分析与数据科学 蜻蜓点水 2008-2-29 15 6467 chenkeli 2014-12-17 22:56:56
SAS MACRO FOR 9.1.3 是准备ADV PROGRAMMING最全面的MACRO方面的资料(350页) attachment 数据分析与数据科学 luyanzheng 2008-2-16 37 8214 henryyhl 2013-6-18 11:29:57
SAS Macro Language Reference attachment 数据分析与数据科学 llulla 2007-5-11 34 8089 nelsonruan 2012-4-30 09:50:18
跪求Macro 电子教材 2006版 SAS专版 masou1983 2009-4-20 5 1958 z348133773 2012-4-6 11:16:32
sas macro(sas 宏) attachment 数据分析与数据科学 dxc90876 2007-1-15 75 16429 well306 2011-11-5 15:13:21
[下载]Excel.VBA.Macro.Programming attachment 金融学(理论版) jerryzhao507 2006-8-30 0 5356 jerryzhao507 2011-10-25 05:18:00
SAS Macro Language (Course Note) attachment 数据分析与数据科学 myzhang1982 2009-2-9 10 4587 tonychu81 2010-5-27 04:30:18
[求助]大家SAS9.2版中macro过程运行正常嘛? SAS专版 realgod5417 2009-5-13 0 1236 realgod5417 2009-5-13 17:50:00
[下载]Macro Stress-Testing on the Loan Portfolio of Japanese Banks attachment 金融学(理论版) diviny 2009-3-31 0 1857 diviny 2009-3-31 15:45:00
求书 Carpenters Complete Guide to the SAS Macro Language, 2nd Edition SAS专版 xuchaokyle 2008-11-28 0 2579 xuchaokyle 2008-11-28 14:48:00
求助:在macro中,如何跳出循环 SAS专版 jackyyyb 2008-9-16 3 6085 PharmD 2008-9-17 02:03:00
Macro and Micro Economic by Mankiw attachment 金融学(理论版) murwhin 2008-7-27 0 2950 murwhin 2008-7-27 21:30:00
STATA请教: 关于MACRO Stata专版 dobel 2006-5-24 2 10291 shaniaover 2006-7-17 19:40:00

相关日志

分享 【转自online tutor】SAS宏小结
huahuaaiqingtia 2015-6-17 09:19
1. systematic macro SYSDATE the date of the SAS invocation (DATE7.) SYSDATE9 the date of the SAS invocation (DATE9.) SYSDAY the day of the week of the SAS invocation SYSTIME the time of the SAS invocation SYSENV FORE (interactive execution) or BACK (noninteractive or batch execution) SYSSCP an abbreviation for the operating system that is being used, such as OpenVMS, WIN, HP 300 SYSVER the release of SAS that is being used SYSJOBID an identifier for the current SAS session or for the current batch job (the user ID or job name for mainframe systems, the process ID (PID) for other systems) Some automatic macro variables have values that automatically change based on submitted SAS statements. SYSLAST the name of the most recently created SAS data set, in the form LIBREF.NAME. This value is always stored in all capital letters. If no data set has been created, the value is _NULL_ SYSPARM text that is specified when SAS is invoked SYSERR contains a return code status that is set by the DATA step and some SAS procedures to indicate if the step or procedure executed successfully 2.user-defined macro The %LET Statement Displaying Macro Variable Values in the SAS Log The SYMBOLGEN Option The %PUT Statement _ALL_ Lists the values of all macro variables _AUTOMATIC_ Lists the values of all automatic macro variables _USER_ Lists the values of all user-defined macro variables %STR function hides the normal meaning of a semicolon and other special tokens and mnemonic equivalents of comparison or logical operators so that they appear as constant text. %NRSTR function performs the same quoting function as %STR, except it also masks macro triggers ( and % %BQUOTE function is used to mask (or quote) special characters and mnemonic operators Macro Functions The %UPCASE Function The %QUPCASE Function The %SUBSTR Function: enables you to extract part of a character string from the value of a macro variable The %QSUBSTR Function The %INDEX Function The %SCAN Function:enables you to extract words from the value of a macro variable The %QSCAN Function The %SYSFUNC Function Creating a Macro Variable During DATA Step Execution CALL SYMPUT(macro-variable,text); CALL SYMPUT(‘macro-variable’, ‘text’); CALL SYMPUT(‘macro-variable’,DATA-step-variable); CALL SYMPUTX(macro-variable,expression); CALL SYMPUT(‘macro-variable’,expression); PUT(source,format.) CALL SYMPUT(expression1,expression2); Creating Macro Variables During PROC SQL Step Execution PROC SQL NOPRINT; SELECT column1,column2,... INTO :macro-variable-1,:macro-variable-2,... FROM table-1 | view-1 WHERE expression other clauses; QUIT; PROC SQL NOPRINT; SELECT column1 INTO :macro-variable-1 SEPARATED BY ‘delimiter1’ FROM table-1 | view-1 WHERE expression other clauses; QUIT; Working with PROC SQL Views proc sql; create view subcnum as select student_name, student_company, paid from sasuser.all where course_number=input(symget(’crsnum’),2.); quit; %let crsnum=4; proc print data=subcnum noobs; title "Status of Students in Course Number crsnum"; run; Using Macro Variables in SCL Programs Referencing Macro Variables Indirectly Obtaining Macro Variable Values During DATA Step Execution SYMGET(macro-variable) CALL SYMPUTN(‘macro-variable’, value); SCL-variable = SYMGETN(‘macro-variable’); 3.macro??? Defining a Macro %MACRO macro-name; text %MEND macro-name; OPTIONS MCOMPILENOTE= NONE | NOAUTOCALL | ALL; Monitoring Execution with System Options OPTIONS MPRINT | NOMPRINT; -------- specified, the text that is sent to the SAS compiler as a result of macro execution is printed in the SAS log OPTIONS MLOGIC | NOMLOGIC; --------- prints messages that indicate macro actions that were taken during macro execution. 4.????macro??? (1)Positional Parameters %MACRO macro-name(parameter-1,...,parameter-n); text %MEND macro-name; (2)Keyword Parameters %MACRO macro-name(keyword-1=value-1,...,keyword-n=value-n); text %MEND macro-name; (3)Mixed Parameter Lists %MACRO macro-name(parameter-1,...,parameter-n, keyword-1=value-1,...,keyword-n=value-n); text %MEND; PARMBUFF option in a macro definition to create a macro that can accept a varying number of parameters at each invocation. 5. Global and local You can create a global macro variable with a %LET statement (used outside a macro definition) a DATA step that contains a SYMPUT routine a DATA step that contains a SYMPUTX routine (beginning in SAS 9) a SELECT statement that contains an INTO clause in PROC SQL The %GLOBAL statement -creates one or more macro variables in the global symbol table and assigns null values to them -can be used either inside or outside a macro definition - has no effect on variables that are already in the global symbol table. %GLOBAL macro-variable-1 ...macro-variable-n; local macro variables with parameters in a macro definition a %LET statement within a macro definition a DATA step that contains a SYMPUT routine within a macro definition a DATA step that contains a SYMPUTX routine within a macro definition (beginning in SAS 9) a SELECT statement that contains an INTO clause in PROC SQL within a macro definition a %LOCAL statement. The %LOCAL statement - can appear only inside a macro definition - creates one or more macro variables in the local symbol table and assigns null values to them - has no effect on variables that are already in the local symbol table Remember, the SYMPUT routine and the SYMPUTX routine can create local variables only if the local table already exists. it is possible to have a local macro variable and a global macro variable that have the same name and different values. OPTIONS MPRINTNEST | NOMPRINTNEST; ----------- allows the macro nesting information to be written to the SAS log in the MPRINT output. This has no effect on the MPRINT output that is sent to an external file. OPTIONS MLOGICNEST | NOMLOGICNEST; -----------allows the macro nesting information to be displayed in the MLOGIC output in the SAS log. 6. Structured statements (1)Conditionally %IF expression %THEN text; %ELSE text; %IF expression %THEN %DO; text and/or macro language statements %END; %ELSE %DO; text and/or macro language statements %END; (2)Iteratively %DO index-variable=start %TO stop %BY increment; text %END; (3)Using Arithmetic and Logical Expressions %EVAL(arithemetic or logical expression); evaluates integer arithmetic or logical expressions. Logical expressions and arithmetic expressions are sequences of operators and operands forming sets of instructions that are evaluated to produce a result. %SYSEVALF(expression, conversion-type); evaluates arithmetic and logical expressions using floating-point arithmetic.
32 次阅读|0 个评论
分享 Micro & Macro Data
aliehs 2013-8-5 22:43
What is macro data? The terms micro and macro data are often used to denote data used in social science research. The distinction between them is, however, not always obvious. Micro data Micro data can generally be described as individual level data. These data have often been collected from each individual through a survey or interview. In such a dataset, each row typically represents an individual person and each column an attribute such as age, gender or job-type. Some well-known surveys that collect this type of data include the European Social Survey (ESS), the General Social Survey (GSS), the World Values Survey (WVS) etc. 'Micro data' would also denote data on individuals collected from governmental administrative systems and registers. While the main distinction is most often drawn between micro and macro data, the term 'meso data' is also sometimes used. Meso data generally refers to data on collective and cooperative actors such as commercial companies, organizations or political parties. Macro data 'Macro data' is generally a term used to describe mainly two subtypes of data; aggregated data system-level data Aggregated macro data provide information constructed by combining information on the lower level units, which the higher level unit is composed of (Diez-Roux 2002). Examples of aggregate data include summaries of the properties of individuals, unemployment statistics, demographics, GDP etc. Most often, aggregated macro data imply that the variables are summaries of the properties of lower level units and not measures of inherent higher level properties. System level macro data yield information about properties of the state or the political system and cannot be disaggregated to lower level units. This type of data form political indicators, such as institutional variables and regime indices, and is not based on summaries of the properties of lower-level units, but measures characteristics of the higher-level units themselves. The MacroDataGuide provides links and qualitative information on a wide range of both aggragated and system-level macro data sources. References Diez-Roux, Ana V. 2002. “A glossary for multilevel analysis”. Journal of Epidemiology and Community Health 56 (August): 588-594. BTW a good glossary of social science data terms: http://3stages.org/glossary/glossary.html#micro
个人分类: Data Analysis|104 次阅读|0 个评论
GMT+8, 2025-12-24 17:48