good programming practice and its importance in the new ... · 3 the metadata world § databases...
TRANSCRIPT
![Page 1: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/1.jpg)
1
Good Programming Practice and Its Importance in the New World of Metadata
Jennifer Chin
PhUSE GPP Board
![Page 2: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/2.jpg)
2
Contents § The metadata world § What are the challenges?
§ What actions can we take? § What difference can they make?
§ Examples
§ Reminder of Key GPP concepts § Summary
![Page 3: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/3.jpg)
3
The Metadata World
§ Databases contains key words, titles, dataset names and variable names
§ Metadata can be used to auto-generate programs
§ Auto generated programs - May call other macros to perform tasks
- May be updated to address data specific issues - May need to be validated
- Will need to be maintained
§ Metadata will change
![Page 4: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/4.jpg)
4
The Metadata World
![Page 5: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/5.jpg)
5
The Metadata World
![Page 6: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/6.jpg)
6
What are the challenges?
§ Metadata changes mid project § Updates required when some studies are already
complete
§ Data issues needs to be addressed
§ Programs used across the globe by programmers of varying skill levels
§ Future proof, updates to the meta data should continue to provide good quality programs
![Page 7: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/7.jpg)
7
What are the challenges?
§ Easy to review and update programs if you have written them or they are well written
§ Knowledge of data and program will be limited as the metadata will most likely be populated by someone else
§ Time taken to review the program - Is it using the correct data - Is the output correct
- Are there any data issues requiring investigation
![Page 8: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/8.jpg)
8
What actions can we take?
§ Define clear specifications § Generic macros generate programs that follow GPP:
- Header: who write it, why, anything special
- Structured program: input, process, output
- Comments: explain what the next part of the program does and why, relate to the specification
- Datasets: use meaningful name, do not overwrite, use different names
- Indent: use consistent spacing
![Page 9: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/9.jpg)
9
What actions can we take?
§ Train individual to improve their SAS skills
§ Provide clear and easy to follow guidelines for programming e.g PhUSE GPP guideline http://www.phusewiki.org/wiki/index.php?title=Good_Programming_Practice_Guidance
§ Ensure GPP is implemented in auto-generated programs
§ Improve quality of our programs so that they are easy to read, understand and maintain over time
![Page 10: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/10.jpg)
10
What difference can they make? § Improve CLARITY and READABILITY § Improve QUALITY and RELIABILITY - Defensive programming
- Structured validation process
§ Easy to MAINTAIN and UPDATE - Informative comments
- Use of macros for common processes
§ Driving STANDARDS and CONSISTENCY
§ Complete TRACEABILITY and TRANSPARENCY § Enforcing BUSINESS RULES
- data integrity and usability
- program re-usability
![Page 11: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/11.jpg)
11
Examples
![Page 12: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/12.jpg)
12
Examples
![Page 13: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/13.jpg)
13
Reminder of Key GPP Concepts
DO Don’t
Programheader Overwritedatasetnames
Structuredprogram Writeverylongdatasteps
Informa;vecomments UseSQLexcessively
Indentconsistently Hardcode
Usedefensiveprogrammingcode
TurnofffulldisclosureofERRORS
UsemacrosandSQLwhenappropriate
ManuallyeditLOGorOUTPUT
![Page 14: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/14.jpg)
14
Summary
§ Following GPP generates programs that are: • Structured, so easy to read and maintain over time
• Easy to validate
• Easy for regulatory to review
§ Use GPP when using metadata to auto-generate programs
§ PhUSE Wiki for guideline and more details:
http://www.phusewiki.org/wiki/index.php?title=Good_Programming_Practice_Guidance
![Page 15: Good Programming Practice and Its Importance in the New ... · 3 The Metadata World § Databases contains key words, titles, dataset names and variable names § Metadata can be used](https://reader033.vdocuments.site/reader033/viewer/2022050504/5f967a867ae4e233050077b8/html5/thumbnails/15.jpg)
15
Questions