Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Creating Formats on the Fly Suzanne M. Dorinski* U.S. Census Bureau *Disclaimer: This paper is released to inform interested parties of ongoing research.

Similar presentations


Presentation on theme: "1 Creating Formats on the Fly Suzanne M. Dorinski* U.S. Census Bureau *Disclaimer: This paper is released to inform interested parties of ongoing research."— Presentation transcript:

1 1 Creating Formats on the Fly Suzanne M. Dorinski* U.S. Census Bureau *Disclaimer: This paper is released to inform interested parties of ongoing research and to encourage discussion. Any views expressed are those of the author and not necessarily those of the U.S. Census Bureau.

2 2 Overview Data used in this example Desired output vs. PROC FREQ default Process text from spreadsheet Control data set for PROC FORMAT Process each variable separately Modify template for PROC FREQ output

3 3 Data used in this example Local Education Agency Universe Survey for School Year 2010-11 Public-use data set from National Center for Education Statistics Links included in paper, full code on sasCommunity.org

4 4

5 5 Data used in this example Desired output vs. PROC FREQ default Process text from spreadsheet Control data set for PROC FORMAT Process each variable separately Modify template for PROC FREQ output

6 6

7 7

8 8 Process text from spreadsheet Use | as delimiter in DOC_FORMATS \emdash creates — in output

9 9

10 10

11 11

12 12

13 13 FORMAT_INFO_TO_TRANSPOSE

14 14 TRANSPOSED_FORMAT_INFO

15 15 Data used in this example Desired output vs. PROC FREQ default Process text from spreadsheet Control data set for PROC FORMAT Process each variable separately Modify template for PROC FREQ output

16 16

17 17 FORMAT_CONTROL_DATA_SET

18 18 Process each variable separately Use a macro to do PROC FREQ on each variable, then append results to master data set. Macro converts numeric variables to character (RACECAT is numeric, all other variables are character). See my 2007 paper for more details.

19 19

20 20

21 21

22 22

23 23 Data used in this example Desired output vs. PROC FREQ default Process text from spreadsheet Control data set for PROC FORMAT Process each variable separately Modify template for PROC FREQ output

24 24

25 25 References Dilorio, Frank and Abolafia, Jeff. 2004. “Dictionary Tables and Views: Essential Tools for Serious Applications”. Dilorio, Frank and Abolafia, Jeff. 2006. “The Design and Use of Metadata: Part Fine Art, Part Black Art”. Dorinski, Suzanne M. 2006. “How To Produce Almost Perfect RTF Output”.

26 26 References (con’t) Dorinski, Suzanne M. 2007. “A Lazy Programmer Case Study: Dynamic Macro Code To Deal With Changing Number of Variables Over Time”. Dorinski, Suzanne M. 2008. “Using ODS Object Oriented Features To Produce A Formatted Record Layout”. Wright, Wendy L. 2007. “Creating a Format from Raw Data or a SAS® Dataset”.

27 27 Acknowledgements Cindy Sheckells, Suzanne McArdle, John Barrow, Mary Ann Koller, Carma Hogue, Terri Craig for comments and suggestions that helped.

28 28 Where I first started learning SAS

29 29 Questions? Suzanne.Marie.Dorinski@census.gov


Download ppt "1 Creating Formats on the Fly Suzanne M. Dorinski* U.S. Census Bureau *Disclaimer: This paper is released to inform interested parties of ongoing research."

Similar presentations


Ads by Google