1
Historical Perspective
2
1965
3
1 Got Married2 First Computer Course
4
Got Married
5
Got Married
6
Got M
arried
7
Got Married
8
Got Married
9 G
ot M
arrie
d
10 Got
Mar
ried
11
Got
Mar
ried
12
Got Married
13
First Computer Course Fortran
14
Fortran Fortran was only 8 years old Already Several Versions
Fortran IV
HOW DO YOU GET THE PROGRAM IN THE COMPUTER?
One of the Big Issues
15
Historical Computing
• Computers were very expensive
16
Historical Computing
• Computers were very expensive
• Could only run one program a time
17
Historical Computing
• Computers were very expensive
• Could only run one program a time
• So one object was to get the program into the computer as fast as possible
18
A Good Media
• The Punched Card • Card Readers
19
A Fortran Cardand Key Punch Machine
20
21
22
23
24
IBM 7094
• Fastest Machine• .35 MIPS• 32K Memory (36 bit
word)• Very Expensive
25
26
IBM 7094
• Fastest Machine• .35 MIPS• 32K Memory (36 bit
word)• Very Expensive• Over 3 Million Dollars
27
28
29
30
31
32
Contract Programmer
• Go from Job to Job• Sometimes call
ourselves gypsies • Subject to technical
interviews
33
Technical Interviews
• Contract programmers
• Level of questions are often quite simple
• Have to do a lot of technical interviews
34
Technical Interviews
• What PROC do you use for printing?
35
Technical Interviews
• What PROC do you use for printing?
• What manual describes the PROCs?
36
SESUG 2012, Durham NC
• Once in a discussion about the quality of questions, a fellow contractor spoke up and said that the best he ever got was:
37
SESUG 2012, Durham NC
• Can you describe the life cycle of a software system?
38
SESUG 2012, Durham NC
• This fellow had just reviewed software • development methods.
• And answer was: Yes
39
40
Needs analysis Systems analysis System design Unit design Unit coding Subsystem coding System coding System acceptance
41
Needs analysis Systems analysis System design Unit design Unit coding Subsystem coding System coding System acceptance
Then it goes forever into maintenance
42
WOW
SESUG 2012, Durham NC
That is what you might do for a Huge System
• With dozens of pages of documentation• If not hundreds
43
SESUG 2012, Durham NC
That is not what we are doing today!
• For a small ad hoc program• ONE sheet (keep it simple)
44
45
Needs analysis Analysis Design
SESUG 2012, Durham NC
The Request
• Usually an email • Stating what the requestor wants
46
SESUG 2012, Durham NC
The Request – part 1
• The Marketing Group is planning to do a telephone survey to determine the interest level for using solar as part of an individual household electrical supply. Needed is a sample of 10,000 customers meeting for following qualifications:
47
SESUG 2012, Durham NC
The Request – part 2Qualifications
• Residential• Household income of at least $75,000• Monthly power usage of at least 2500 Kwh• Live in the metro area
48
SESUG 2012, Durham NC
The Request – part 3
• Needed for each person in the sample: Name Address Telephone number Age Solar user
49
I build single sheet starting with three columns
• Item number• Flag• User request
50
51
Spec Sheet
Item Flag User request
1Residential
2Income level
3Power usage
4Metro
5Name
6Address
7Phone Num
8Age
9Solar user
SESUG 2012, Durham NC
Note that in the items in the request fall into two categories:
• Selection criteria (items 1 - 4)• Needed information (items 5 – 9)
52
SESUG 2012, Durham NC
I use the flag column
• S - selection criteria • I - needed information
53
54
Spec Sheet
Item Flag User request
1S Residential
2S Income level
3S Power usage
4S Metro
5I Name
6I Address
7I Phone Num
8I Age
9I Solar user
SESUG 2012, Durham NC
As Programmers and Analysts Know
• Now the work begins – • Finding the needed items (data)
55
SESUG 2012, Durham NC
Identification of data includes:
• Databases, • Tables, • Variables, • Values for the variables,
56
SESUG 2012, Durham NC
And – Oh Yes
• Specialized routines if needed.
57
SESUG 2012, Durham NC
More columns are needed in the spec sheet.
• Database (DB)• Table • Variable (Var)• Values• Footnote (FN) {to identify special routines}
58
59
Spec SheetItem Flag User request BK DB /
LibTable Var Values FN
1S Residential
2S Income level
3S Power usage
4S Metro
5I Name
6I Address
7I Phone Num
8I Age
9I Solar user
60
Data discovery time is a luxury that programmers don’t always have when starting a new project
61
Large organizations have a lot of databases and tables to explore.
62
A neophyte programmer or even a seasoned programmer new on the job can be challenged to find source locations for all of the data required on a new report.
63
Imagine walking through the office trying to network with others about where to find data.
64
Having a printed copy of a spec sheet will be helpful to use as a visual aid during conversations.
SESUG 2012, Durham NC
Fill in what you can on your own
65
66
Spec SheetItem Flag User request BK DB /
LibTable Var Values FN
1S Residential CQ bill tartyp 1
2S Income level
3S Power usage
4S Metro
5I Name
CQ bill name as shown
6I Address
CQ bill serv_ad
7I Phone Num
CQ bill phone
8I Age
9I Solar user
SESUG 2012, Durham NC
Then Go get Help!
• Before going after help you might pencil in the names of the most likely people that would have the answer
• If you do not have a clue leave it blank and ask every one
67
68
Spec SheetItem Flag User request BK DB /
LibTable Var Values FN
1S Residential CQ bill tartyp 1
2S Income level BH
3S Power usage LG
4S Metro BB
5I Name
CQ bill name as shown
6I Address
CQ bill serv_ad
7I Phone Num
CQ bill phone
8I Age C
9
I Solar user
Do not have a clue
SESUG 2012, Durham NC
As you go from person to person getting answers
• Pencil in the information
69
70
Spec SheetItem Flag User request BK DB /
LibTable Var Values FN
1S Residential CQ bill tartyp 1
2S Income level
MON monthly
income 7 or above
3S Power usage
Use usage kwh_nn ge 2500 1
4S Metro
CNTY cnty_cd county 2
5I Name
CQ bill name as shown
6I Address
CQ bill serv_ad 3
7I Phone Num
CQ bill phone 4
8I Age
MON monthly
age
9I Solar user
CQ bldg tariff u1,v1
SESUG 2012, Durham NC
You have a choice
• Use it as is or• Go back to your work station (computer) and
enter the new information into the sheet
71
72
SESUG 2012, Durham NC
OOPs
• Some one slipped in an old frame• Were back on the dark ages
73
SESUG 2012, Durham NC
• Put in the updated information and • Do not forget the footnotes
74
75
Spec SheetItem
Flag User requirement
BK DB Table Var Values FN
1 S Residential CQ bill tartyp 12 S Income level MON monthl
yincome 7 or
above3 S Power usage Use usage kwh_nn ge 2500 14 S Metro CNT
Ycnty_cd county 2
5 I Name CQ bill name as shown
6 I Address CQ bill serv_ad 37 I Phone num CQ bill phone 48 I Age MON monthl
yage
9 I Solar user CQ bldg tariff u1,v110 I NO CONTACT CNT contact nocontac
tnc,nmnc
Footnote 1: average the past 12 months where nn=01…12Footnote 2: select only metro area countiesFootnote 3: %inc ‘parseAD’Footnote 4: %inc ‘parsePH’
Do You see any Advantages in Creating a Spec Sheet?
76
Do You see any Advantages in Creating a Spec Sheet?
• Structured guide in finding the data
77
Do You see any Advantages in Creating a Spec Sheet?
• Structured guide in finding the data
• Provides a visual when consulting with co-workers
78
Do You see any Advantages in Creating a Spec Sheet?
• Structured guide in finding the data
• Provides a visual when consulting with co-workers
• Provides a check list when writing the program
79
SESUG 2012, Durham NC
Cross Reference Between Spec Sheet and Program
Wouldn’t it be good to link each item in the spec sheet to a location in the program
80
SESUG 2012, Durham NC
Back in the days of Fortran
• We used statements numbers
• In SAS line numbers could work• Except that when • Adding or deleting a line • The line numbers change
81
82
A Better Way
83
Back in my teaching days
SESUG 2012, Durham NC
Three Block Postulates
• A program consists of blocks• A block must be entered at the top and exited
from the bottom• Blocks can be nested
84
SESUG 2012, Durham NC
No Way!
• We are not going to be that rigorous today• SAS naturally is block structured• Data steps• PROCs
85
SESUG 2012, Durham NC
Blocks in SAS
• A block can be as small as one data step or one PROC
• Or you and group a few together (think about one function)
86
SESUG 2012, Durham NC
Blocks in SAS
• All you have to do is place a comment before and after the block (with a number)
• Blocks should be numbered in sequence
87
88
*Block 1; lines of SAS code . .*End Block 1;
*Block 2; lines of SAS code . .* End Block 2;
SESUG 2012, Durham NC
Connecting Lines in the Spec Sheet to the Program
• Simple:• Just place the block number of the block that
satisfies the requirement in the Block column (BK) of the spec sheet
89
90
*Block 1;Proc SQL; create table grump as select id, tartyp, name, add, phone from CQ.bill where tartyp = 1;quit;
*Block 2; lines of SAS code . .* End Block 2;
91
Spec SheetItem
Flag User requirement
BK DB Table Var Values FN
1 S Residential 1 CQ bill tartyp 12 S Income level MON monthl
yincome 7 or
above3 S Power usage Use usage kwh_nn ge 2500 14 S Metro CNT
Ycnty_cd county 2
5 I Name 1 CQ bill name as shown
6 I Address CQ bill serv_ad 37 I Phone num CQ bill phone 48 I Age MON monthl
yage
9 I Solar user CQ bldg tariff u1,v110 I NO CONTACT CNT contact nocontac
tnc,nmnc
Footnote 1: average the past 12 months where nn=01…12Footnote 2: select only metro area countiesFootnote 3: %inc ‘parseAD’Footnote 4: %inc ‘parsePH’
92
*Block 1;Proc SQL; create table grump as select id, tartyp, name, add, phone from CQ.bill where tartyp = 1;quit;
*Block 2; Proc SQL; create table inc as select id, income, age from MON.monthly where income ge 7;quit;* End Block 2;
93
Spec SheetItem
Flag User requirement
BK DB Table Var Values FN
1 S Residential 1 CQ bill tartyp 12 S Income level 2 MON monthl
yincome 7 or
above3 S Power usage Use usage kwh_nn ge 2500 14 S Metro CNT
Ycnty_cd county 2
5 I Name 1 CQ bill name as shown
6 I Address CQ bill serv_ad 37 I Phone num CQ bill phone 48 I Age 2 MON monthl
yage
9 I Solar user CQ bldg tariff u1,v110 I NO CONTACT CNT contact nocontac
tnc,nmnc
Footnote 1: average the past 12 months where nn=01…12Footnote 2: select only metro area countiesFootnote 3: %inc ‘parseAD’Footnote 4: %inc ‘parsePH’
94
Spec SheetItem
Flag User requirement
BK DB Table Var Values FN
1 S Residential 1 CQ bill tartyp 12 S Income level 2 MON monthl
yincome 7 or
above3 S Power usage 3 Use usage kwh_nn ge 2500 14 S Metro 4 CNT
Ycnty_cd county 2
5 I Name 1 CQ bill name as shown
6 I Address 5 CQ bill serv_ad 37 I Phone num 6 CQ bill phone 48 I Age 2 MON monthl
yage
9 I Solar user 7 CQ bldg tariff u1,v110 I NO CONTACT 8 CNT contact nocontac
tnc,nmnc
Footnote 1: average the past 12 months where nn=01…12Footnote 2: select only metro area countiesFootnote 3: %inc ‘parseAD’Footnote 4: %inc ‘parsePH’
SESUG 2012, Durham NC
You have a choice
• Use it as is or• Go back to your work station (computer) and
enter the new information into the sheet
95
96
SESUG 2012, Durham NC
What are the advantages?
• Provides a guide for program review
97
SESUG 2012, Durham NC
What are the advantages?
• Provides a guide for program review• Acts as an index into the program
98
SESUG 2012, Durham NC
What are the advantages?
• Provides a guide for program review• Acts as an index into the program• Enables any programmer to quickly become
familiar with the existing SAS code
99
SESUG 2012, Durham NC
What are the advantages?
• Provides a guide for program review• Acts as an index into the program• Enables any programmer to quickly become
familiar with the existing SAS code• Easier to work on program modifications
100
101
Features Matrix
SESUG 2012, Durham NC
Features Matrix
• Have you every ask yourself the question: Where have I done this before?
102
SESUG 2012, Durham NC
Features Matrix
• Have you every ask yourself the question: Where have I done this before? or
• Hmmm: In which program did I do this?
103
SESUG 2012, Durham NC
Features Matrix
• There is a relatively simple solution
104
SESUG 2012, Durham NC
Features Matrix
• There is a relatively simple solution• But you do have to spend a few minutes
during or after each program
105
SESUG 2012, Durham NC
Features Matrix
• There is a relatively simple solution• But you do have to spend a few minutes
during or after each program• Build a features matrix
106
SESUG 2012, Durham NC
Features Matrix
• Build a two dimensional matrix consisting of:• Major Features versus • Program Titles
107
108
SOLARGREEN
BUS INESSSAMPLE
INDUSTRALSAMPLE
OUTDOORLIGHTING
AUTODEALERS
SINGLEFAMILYHOMES
WATERHEATERTYPES
PAPERLESSCAMPAIGN
CQ X X X X X X
MON X X
USE X X X X
CNTY X X X X X X X
CNT X X X X X X
%inc ‘parseAD’ X X X X X
%inc ‘parsePH’ X X X X X
No contact code
X X X X X X
Ave power code
X X X
PROC IMPORT X X
PROC EXPORT
X X X X X X X X
109
Flower Box
SESUG 2012, Durham NC
Flower Box
• flower box (plural flower boxes)1.A container in which flowers or plants are
grown, usually affixed outside just below a window.
110
SESUG 2012, Durham NC
Flower Box
flower box (plural flower boxes)1.A container in which flowers or plants are
grown, usually affixed outside just below a window.
2.(computing, programming) A comment in source code that spans several lines, each of which begins with an asterisk.
111
112
\******************************************/ \****************************************/ \**************************************/ \************************************/ \**********************************/ \********************************/
113
/********************************************//* */ /* *//* */ /* *//* *//* *//********************************************/
114
/***********************************************//* *//* Program: Solar and Green *//* *//* Objective: Produce a survey list *//* *//* Program Path: S:\ad hoc */ /* \Solar and Green\Programs *//* *//* Author: Robert McCurdy */ /* Date: 25AUG *//***********************************************/
What should go into the Box
• Name of the program• Brief statement of
objective• Path where the
program is stored• Path where the data is
stored• Input• Output
• Prerequisite programs which need to be executed (if any)
• Hard coded dates or other parameters which may need to be changed (show block numbers)
• Author• Date written
115
Continued
• Called programs (if any)• Data preparation (if
any)
116
Take time to smell the flowers
• Go home and plant some flowers
• Or take some flowers to someone you care about
117
118
The End