SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange...

23
Dynamic Data Exchange SAS and DDE JC Wang wang (WMU) SAS and DDE Lecture 18 1/8

Transcript of SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange...

Page 1: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

SAS and DDE

JC Wang

wang (WMU) SAS and DDE Lecture 18 1 / 8

Page 2: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Outline

1 Dynamic Data ExchangeDynamic Data ExchangeResourcesUsing DDE

wang (WMU) SAS and DDE Lecture 18 2 / 8

Page 3: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

What is DDE?

DDE, Dynamic Data Exchange, is a built-in protocal in MicrosoftWindows that allows applications to share data (chat amongapplications, that is)

wang (WMU) SAS and DDE Lecture 18 3 / 8

Page 4: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 5: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 6: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 7: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 8: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 9: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Use DDE with Excel in SAS

can dump SAS data directly into cells in Excelcan easily format cells (colors, fonts, outlines, etc)can write formulas to cellscan create/kick off macros from within SAScan issue system commands such as saving workbook to files,rename worksheets, etc.

wang (WMU) SAS and DDE Lecture 18 4 / 8

Page 10: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

SUGI Papers

Besides SAS help documentation for Windows, many SUGI paperscovered this topic, two important ones:

“Using Dynamic Data Exchange to Export Your SAS Data to MSExcel — Against All ODS, Part I —” SUGI 26 (Paper 11-26) byKoen Vyverman.“Creating Custom Excel Workbooks from Base SAS with DynamicData Exchange: A Complete Walkthrough” SUGI 27 (Paper190-27) by Koen Vyverman.

wang (WMU) SAS and DDE Lecture 18 5 / 8

Page 11: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

SUGI Papers

Besides SAS help documentation for Windows, many SUGI paperscovered this topic, two important ones:

“Using Dynamic Data Exchange to Export Your SAS Data to MSExcel — Against All ODS, Part I —” SUGI 26 (Paper 11-26) byKoen Vyverman.“Creating Custom Excel Workbooks from Base SAS with DynamicData Exchange: A Complete Walkthrough” SUGI 27 (Paper190-27) by Koen Vyverman.

wang (WMU) SAS and DDE Lecture 18 5 / 8

Page 12: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

SUGI Papers

Besides SAS help documentation for Windows, many SUGI paperscovered this topic, two important ones:

“Using Dynamic Data Exchange to Export Your SAS Data to MSExcel — Against All ODS, Part I —” SUGI 26 (Paper 11-26) byKoen Vyverman.“Creating Custom Excel Workbooks from Base SAS with DynamicData Exchange: A Complete Walkthrough” SUGI 27 (Paper190-27) by Koen Vyverman.

wang (WMU) SAS and DDE Lecture 18 5 / 8

Page 13: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Using DDE

Prerequisite for using DDE: both client and server applications are upand running. A client/server DDE communication link is initiated bymeans of a special form of the SAS filename statement in two ways:

DDE triplet :

FILENAME fileref DDE ’<server app>|<topic>!<item>’;DDE ‘doublet’ :

FILENAME fileref DDE ’<server app>|system’;

wang (WMU) SAS and DDE Lecture 18 6 / 8

Page 14: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Using DDE

Prerequisite for using DDE: both client and server applications are upand running. A client/server DDE communication link is initiated bymeans of a special form of the SAS filename statement in two ways:

DDE triplet :

FILENAME fileref DDE ’<server app>|<topic>!<item>’;DDE ‘doublet’ :

FILENAME fileref DDE ’<server app>|system’;

wang (WMU) SAS and DDE Lecture 18 6 / 8

Page 15: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Using DDE

Prerequisite for using DDE: both client and server applications are upand running. A client/server DDE communication link is initiated bymeans of a special form of the SAS filename statement in two ways:

DDE triplet :

FILENAME fileref DDE ’<server app>|<topic>!<item>’;DDE ‘doublet’ :

FILENAME fileref DDE ’<server app>|system’;

wang (WMU) SAS and DDE Lecture 18 6 / 8

Page 16: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

DDE Triplet Example<server app> = excel<topic> = [myXcel.xlsx]sheet1, [myXcel.xlsx]my data sheet<item> = r1c1:r10c3

wang (WMU) SAS and DDE Lecture 18 7 / 8

Page 17: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

DDE Triplet Example<server app> = excel<topic> = [myXcel.xlsx]sheet1, [myXcel.xlsx]my data sheet<item> = r1c1:r10c3

wang (WMU) SAS and DDE Lecture 18 7 / 8

Page 18: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

DDE Triplet Example<server app> = excel<topic> = [myXcel.xlsx]sheet1, [myXcel.xlsx]my data sheet<item> = r1c1:r10c3

wang (WMU) SAS and DDE Lecture 18 7 / 8

Page 19: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

DDE Triplet Example<server app> = excel<topic> = [myXcel.xlsx]sheet1, [myXcel.xlsx]my data sheet<item> = r1c1:r10c3

wang (WMU) SAS and DDE Lecture 18 7 / 8

Page 20: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Examples of Writing to ExcelUsing DDE doublet

in the form of (in DATA _NULL_):

PUT ’[system-command]’;

PUT ’[save.as("f:\myXcel.xlsx")]’; — save excelPUT ’[format("Courier", 200, true, false, false,false, 3, false, false)]’; — change font“font name”, font size, bold, italic, underline, strike-through, color,outline, shadowPUT ’[workbook.name("sheet1","my SAS data")]’; —rename sheet

wang (WMU) SAS and DDE Lecture 18 8 / 8

Page 21: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Examples of Writing to ExcelUsing DDE doublet

in the form of (in DATA _NULL_):

PUT ’[system-command]’;

PUT ’[save.as("f:\myXcel.xlsx")]’; — save excelPUT ’[format("Courier", 200, true, false, false,false, 3, false, false)]’; — change font“font name”, font size, bold, italic, underline, strike-through, color,outline, shadowPUT ’[workbook.name("sheet1","my SAS data")]’; —rename sheet

wang (WMU) SAS and DDE Lecture 18 8 / 8

Page 22: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Examples of Writing to ExcelUsing DDE doublet

in the form of (in DATA _NULL_):

PUT ’[system-command]’;

PUT ’[save.as("f:\myXcel.xlsx")]’; — save excelPUT ’[format("Courier", 200, true, false, false,false, 3, false, false)]’; — change font“font name”, font size, bold, italic, underline, strike-through, color,outline, shadowPUT ’[workbook.name("sheet1","my SAS data")]’; —rename sheet

wang (WMU) SAS and DDE Lecture 18 8 / 8

Page 23: SAS and DDE - Statistics Data Exchange Outline 1 Dynamic Data Exchange Dynamic Data Exchange Resources Using DDE wang (WMU)SAS and DDE Lecture 18 2 / 8

Dynamic Data Exchange

Examples of Writing to ExcelUsing DDE doublet

in the form of (in DATA _NULL_):

PUT ’[system-command]’;

PUT ’[save.as("f:\myXcel.xlsx")]’; — save excelPUT ’[format("Courier", 200, true, false, false,false, 3, false, false)]’; — change font“font name”, font size, bold, italic, underline, strike-through, color,outline, shadowPUT ’[workbook.name("sheet1","my SAS data")]’; —rename sheet

wang (WMU) SAS and DDE Lecture 18 8 / 8