copyright 2007, information builders. slide 1 all new one liners for focus and webfocus efficiencies...
TRANSCRIPT
Copyright 2007, Information Builders. Slide 1
All New One Liners for FOCUS and All New One Liners for FOCUS and WebFOCUS EfficienciesWebFOCUS Efficiencies
Joel StarkmanJoel Starkman
Director of OperationsDirector of OperationsJune 2008June 2008
‘Highway Blues’ from the “Speaking Out” albumMark Seales, composer; Ernie Watts, saxophone
Jump to endCopyright 2007, Information Builders. Slide 2
One-Liners For [Web]FOCUS Efficiency
*Your mileage may vary
Perform one extra pre-step in your process, or
Replace one type of statement with another, or
Add one line into or before your request, or
Issue just one additional SET statement, or
Increase the appropriate default limit value
Perform one extra pre-step in your process, or
Replace one type of statement with another, or
Add one line into or before your request, or
Issue just one additional SET statement, or
Increase the appropriate default limit value
Jump to endCopyright 2007, Information Builders. Slide 3
Prove it - How do I see these savings?
STATISTICS OF LAST COMMAND RECORDS = 0 SEGS DELTD = 0 LINES = 0 NOMATCH = 0 BASEIO = 0 DUPLICATES = 0 SORTIO = 0 FORMAT ERRORS = 0 SORT PAGES = 0 INVALID CONDTS = 0 READS = 0 OTHER REJECTS = 0 TRANSACTIONS = 0 CACHE READS = 0 ACCEPTED = 0 MERGES = 0 SEGS INPUT = 0 SORT STRINGS = 0 SEGS CHNGD = 0 INDEXIO = 0 INTERNAL MATRIX CREATED: YES AUTOINDEX USED: NO SORT USED: FOCUS AUTOPATH USED: NO AGGREGATION BY EXT.SORT: NO HOLD FROM EXTERNAL SORT: NO
STATISTICS OF LAST COMMAND RECORDS = 0 SEGS DELTD = 0 LINES = 0 NOMATCH = 0 BASEIO = 0 DUPLICATES = 0 SORTIO = 0 FORMAT ERRORS = 0 SORT PAGES = 0 INVALID CONDTS = 0 READS = 0 OTHER REJECTS = 0 TRANSACTIONS = 0 CACHE READS = 0 ACCEPTED = 0 MERGES = 0 SEGS INPUT = 0 SORT STRINGS = 0 SEGS CHNGD = 0 INDEXIO = 0 INTERNAL MATRIX CREATED: YES AUTOINDEX USED: NO SORT USED: FOCUS AUTOPATH USED: NO AGGREGATION BY EXT.SORT: NO HOLD FROM EXTERNAL SORT: NO
-SET &STARTCPU = &FOCCPU ;TABLE, etc….-RUN-SET &ENDCPU = &FOCCPU ;-SET &USED=(&ENDCPU - &STARTCPU) /1000;-TYPE Table used &USED CPU seconds
-SET &STARTCPU = &FOCCPU ;TABLE, etc….-RUN-SET &ENDCPU = &FOCCPU ;-SET &USED=(&ENDCPU - &STARTCPU) /1000;-TYPE Table used &USED CPU seconds
TABLE/
MATCHMODIFY/
MAINTAIN
MODIFY/
MAINTAIN
Capture CPU in-stream
TABLE, etc….? STAT
Examine your post-execution
operating system statistics
Examine your post-execution
operating system statistics
Jump to endCopyright 2007, Information Builders. Slide 4
Data already sorted in the order of the report request?
Use TABLEF !!
“Why is it that when you transport something by car, it's called a shipment, but when you transport something by
ship, it's called cargo?”
Steven Wright
Use TABLEF when appropriate
TABLE FILE CARSUM DCOSTBY COUNTRY BY CAR ON CAR SUBFOOTEND
TABLE FILE CARSUM DCOSTBY COUNTRY BY CAR ON CAR SUBFOOTEND
Extractdata
Sort andMergedata
Generatereport
You can still use COMPUTE, SUM and WHERE TOTAL
F
AVINGS: Eliminates large cost of sorting, even if none to do. S
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 5
"If you live to the age of a hundred you have it made because very few people die past the age of a hundred.”
George Burns
Use JOIN instead of WHERE IN FILE
TABLE FILE CARPRINT COUNTRYWHERE COUNTRY NE 'ENGLAND'ON TABLE HOLD AS VALUES FORMAT ALPHAEND
TABLE FILE CARPRINT COUNTRYWHERE COUNTRY NE 'ENGLAND'ON TABLE HOLD AS VALUES FORMAT ALPHAEND
AVINGS: JOIN is generally faster than a file search for each recordS
born Nathan Birnbaum
One Liners For FOCUS Efficiency
TABLE FILE CARSUM SEATS BY COUNTRYWHERE COUNTRY IN FILE VALUESEND? STAT
TABLE FILE CARSUM SEATS BY COUNTRYWHERE COUNTRY IN FILE VALUESEND? STAT JOIN COUNTRY IN VALUES TO COUNTRY IN CAR AS J1
TABLE FILE VALUESSUM SEATS BY COUNTRYEND? STAT
JOIN COUNTRY IN VALUES TO COUNTRY IN CAR AS J1TABLE FILE VALUESSUM SEATS BY COUNTRYEND? STAT
Donated by Art Greenhaus
Jump to endCopyright 2007, Information Builders. Slide 6
“Apparently, a new survey says that three out of four people make up 75% of the population.”
David Letterman
Do the HOLDs after the END
TABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS HTMLENDTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS EXL2KENDTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS PDFEND
TABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS HTMLENDTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS EXL2KENDTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS PDFEND
SET SAVEMATRIX = ONTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS HTMLENDHOLD AS EXL2KHOLD AS PDF
SET SAVEMATRIX = ONTABLE FILE CARPRINT COUNTRY CARON TABLE HOLD AS HTMLENDHOLD AS EXL2KHOLD AS PDF
HOLD’ing the same results in 3 different formats?
AVINGS: 50% for 2 HOLD, 66% for 3 HOLDS, etc.SRe-uses internal matrix from first to generate others
Re-extracts entire data set
3 times
Re-extracts entire data set
3 times
Re-extracts entire data set
3 times
One Liners For FOCUS Efficiency
Instead:
Jump to endCopyright 2007, Information Builders. Slide 7
Use POOLED TABLES for multiple TABLEs
“Always get married in the morning. That way if it doesn’t work out, you haven’t wasted the whole day.”
Mickey Rooney
AVINGS: 1/nth of I/O’s where n is number of TABLES.S
TABLE FILE HUGESUM …IF REGION EQ ‘NORTH’ENDTABLE FILE HUGESUM …IF REGION EQ ‘SOUTH’ENDTABLE FILE HUGESUM …IF REGION EQ ‘EAST’ENDTABLE FILE HUGESUM …IF REGION EQ ‘WEST’END
TABLE FILE HUGESUM …IF REGION EQ ‘NORTH’ENDTABLE FILE HUGESUM …IF REGION EQ ‘SOUTH’ENDTABLE FILE HUGESUM …IF REGION EQ ‘EAST’ENDTABLE FILE HUGESUM …IF REGION EQ ‘WEST’END
Why extract the
entire database
four times?
SET POOL= ONSET POOL= ON
SET POOL= OFFSET POOL= OFF
•No HOLD file needed
•Extracts from database once
•Feeds all TABLEs at one time
•Output identical to no pooling
•Set ESTLINES/ESTRECORDS for even more efficiency
Note: Pooled Tables is a chargeable feature.Must SET POOLFEATURE=ON in FOCPARM
born Joseph Yule, Jr.
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 8
"I always wanted to be somebody, but I should have been more specific."
Lily Tomlin
Don’t read the entire flat file
AllenBeattyBullockDenverKidman..Zappa
SET FIXRETRIEVE=ON
TABLE FILE NAMES
PRINT NAME
IF NAME LT ‘E’
END
SET FIXRETRIEVE=ON
TABLE FILE NAMES
PRINT NAME
IF NAME LT ‘E’
ENDO
ne M
illion R
ecords
Ten R
ecords
*Only for flat files via SEGTYPE
AVINGS: Average 50% search time; could save 1% or 99%.S
“The flat file is sorted on the screened field; stop searching when you see a larger value.”
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 9
“Somebody actually complimented me on my driving today. They left a little note on the windshield.
It said 'Parking Fine’.”
Tommy Cooper
Reformat fields inside the TABLE instead of DEFINE
DEFINE FILE CAR-* DCOST is originally D12.2INTCOST/I6 = DCOST ;ENDTABLE FILE CARSUM COST
INTCOSTBY CAREND
DEFINE FILE CAR-* DCOST is originally D12.2INTCOST/I6 = DCOST ;ENDTABLE FILE CARSUM COST
INTCOSTBY CAREND
TABLE FILE CARSUM DCOST
DCOST/I6 AS ‘INTCOST’BY CAREND
TABLE FILE CARSUM DCOST
DCOST/I6 AS ‘INTCOST’BY CAREND
No DEFINE needed(but creates extra field in matrix)
Hint: Extra field appears in a HOLD file. To remove, SET HOLDLIST=PRINTONLY
AVINGS: Only final displayed field is reformatted.S
One Liners For FOCUS Efficiency
Instead:
Jump to endCopyright 2007, Information Builders. Slide 10
COUNTRY
CAR
MODEL
BODYDCOST
“You look at the floor and see the floor. I look at the floor and see molecules.”
Dan Aykroyd
Flip to Alternate File View to elevate screening criteria
COUNTRY
CAR
MODEL
BODYDCOST
COUNTRY
CAR
MODEL
BODYDCOST
Why follow pointers all the
way to the bottom, just to find that a DCOST does not fit the criteria?
TABLE FILE CARPRINT MODEL DCOSTIF DCOST GE 20000END
TABLE FILE CARPRINT MODEL DCOSTIF DCOST GE 20000END
.DCOST
P
O
I
N
T
E
R
S
AVINGS: Tremendous reductions in I/O and response time.S
One Liners For FOCUS Efficiency
BODY
MODEL
CAR
COUNTRY
DCOST
Jump to endCopyright 2007, Information Builders. Slide 11
COUNTRY
CAR
MODEL
BODYDCOST
“If dogs could talk, it would take a lot of the fun out of owning one.”
Use Indexed File View to elevate screening criteria
COUNTRY
CAR
MODEL
BODYDCOST
COUNTRY
CAR
MODEL
BODYDCOST
Same dot-syntax as alternate view;
uses index automatically when present.
TABLE FILE CARPRINT MODEL DCOSTIF DCOST GE 20000END
TABLE FILE CARPRINT MODEL DCOSTIF DCOST GE 20000END
.DCOST
P
O
I
N
T
E
R
S
BODY
MODEL
CAR
COUNTRY
DCOST
AVINGS: Tremendous reductions in I/O and response time.S
Andy Rooney
One Liners For FOCUS Efficiency
Note: Index view requires test on indexed field
Jump to endCopyright 2007, Information Builders. Slide 12
System SortSYNCSORT
DFSORTVMSORT
“We spend the first twelve months of our children’s lives teaching them to walk and talk, and the next twelve
telling them to sit down and shut up.”
Phyllis Diller
Let your Sort Utility do all the work –not just the sorting!
HOLD File
FOCUSSort
SET EXTSORT=ON
SET EXTAGGR=ON
SET EXTHOLD=ON
SAVINGS: Tremendous reductions in sort time and data movement.
born Phyllis Ada Driver
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 13
“I’m the kind of guy who will have nothing all my life and then they’ll discover oil while digging my grave.”
George Gobel
Presort the data before loading
A B C D E F G H I J
EHFGD
Unsorted
MODIFY FILE …FIXFORM keyfieldMATCH keyfieldON NOMATCH UPDATEDATA ON …
Sort the data file first
P a g e 1 P a g e 2 P a g e 3 P a g e 4
“If it’s not ahead of me, I have
to start from the top.” - FOCUS
SAVINGS: Could be 100’s of times faster on large volumes.
Call system sortDEFGH
Sorted
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 14
“Getting on a plane, I told the ticket agent to send one of my bags to New York and the other to LA. She said
she can’t do that. I told her she did it last week”.
Henny Youngman
REBUILD without the Index first
FILE = …SEGMENT = …FIELD=ABC,,I5, FIELDTYPE=I ,$FIELD=DEF,,A12,$FIELD=GHI,,D12.2, FIELDTYPE=I ,$FIELD=JKL,,F5,$
FILE = …SEGMENT = …FIELD=ABC,,I5, FIELDTYPE=I ,$FIELD=DEF,,A12,$FIELD=GHI,,D12.2, FIELDTYPE=I ,$FIELD=JKL,,F5,$
1. Remove indexes and save as alternate master2. REBUILD REBUILD with no-index master3. Put back original master with indexes4. REBUILD INDEX
AVINGS: Usually measured in hours of elapsed time savings.S
One Liners For FOCUS Efficiency
* (up to 7 indexes)
Jump to endCopyright 2007, Information Builders. Slide 15
“I find television very educating. Every time somebody turns on the set, I go into the other room and
read a book.”
Groucho Marx
JOIN in the faster direction
FILE=JOBSEGMENT=JOB1, …FIELD=POS, …, INDEX=I,$FIELD=BLDG, … …
FILE=JOBSEGMENT=JOB1, …FIELD=POS, …, INDEX=I,$FIELD=BLDG, … …
Lorenzo Alcazar PresidentNicolas Cassadine Vice PresidentCarly Corinthos OperatorMichael Corinthos, III OperatorSonny Corinthos PresidentAlexis Davis TechnicalNoah Drake ManagerPatrick Drake OperatorJasper "Jax" Jacks PresidentGeorgie/Maxie Jones OperatorsRic Lansing TechnicalSamantha McCall OperatorJason Morgan TechnicalDillon Quartermaine Vice PresidentEdward Quartermaine ManagerTracy Quartermaine OperatorSkye Quartermaine SecretaryEmily Quartermaine ManagerDr. Monica Quartermaine TechnicalMalcolm ‘Mac’ Scorpio ManagerRobert Scorpio TechnicalDr. Robin Scorpio TechnicalBobbie Spencer SecretaryElizabeth Spenser SecretaryLucky/Lulu Spencer OperatorsLuke Spencer PresidentElizabeth Webber Technical
JOIN POS IN GH TO POS IN JOBJOIN POS IN GH TO POS IN JOB
FILE=GHSEGMENT=GH1, …FIELD=NAME, …FIELD=POS, …INDEX=I,$…
FILE=GHSEGMENT=GH1, …FIELD=NAME, …FIELD=POS, …INDEX=I,$…
TABLE FILE ????PRINT NAMEWHERE BLDG IS ‘C2’ END
TABLE FILE ????PRINT NAMEWHERE BLDG IS ‘C2’ END
Manager A1Operator C2President C2Secretary B3Technical C2Vice Pres A1
JOIN POS IN JOB TO POS IN GHJOIN POS IN JOB TO POS IN GH
JOB
SAVINGS: Could reduce processing time by 90% or more.
born Julius Henry Marx
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 16
>> rebuildENTER OPTIONexternal indexNEW OR ADD TO EXISTING?. . .
-AHP F - - - - - - - - - -FGJH JIDSA EJSDQR WLFS Z - - - - - - - - - - -ZWIO H
AAACDDEFHHHJ....
UWXYZZ
On
e Million
Record
s
SAVINGS: Could reduce data accessing time by 90% or more.
EXTERNAL
INDEX
“I base most of my fashion taste on what doesn't itch.”
Gilda Radner
Build your own External Index when you don’t have write access to the file
USE mastername extindexname INDEX mastername ENDTABLE FILE filename.indexfield
Non-writeable
file, no index
Build your own index#
#Note:External Index is static - not updated per transaction. Must Rebuild Index if file changes, say nightly.
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 17
BY TOTAL – Sort by computed columns in one pass
AVINGS: Eliminates second pass of the data – could be 50%.S
“I was born with an adult head and a tiny body. Like a 'Peanuts' character.”
John Stewart
Sort by Average Sales*
COUNTRY CAR AVE SALES SALESENGLAND JENSEN 17650 73000 TRIUMPH 24200 122000JAPAN HONDA 17480 235000 TOYOTA 18250 197300
Sort by Average Sales*
COUNTRY CAR AVE SALES SALESENGLAND JENSEN 17650 73000 TRIUMPH 24200 122000JAPAN HONDA 17480 235000 TOYOTA 18250 197300TABLE FILE CAR SUM SALES AVE.SALES BY COUNTRY BY CARON TABLE HOLDENDTABLE FILE HOLD SUM E03 BY COUNTRY BY CAR BY E04 AS ‘Ave Sales’’ END
TABLE FILE CAR SUM SALES AVE.SALES BY COUNTRY BY CARON TABLE HOLDENDTABLE FILE HOLD SUM E03 BY COUNTRY BY CAR BY E04 AS ‘Ave Sales’’ END
TABLE FILE CAR SUM SALES BY COUNTRY BY CAR BY TOTAL AVE.SALESEND
TABLE FILE CAR SUM SALES BY COUNTRY BY CAR BY TOTAL AVE.SALESEND
*Invented numbers
No HOLD !
BY AVE.SALES
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 18
DEFINE FILE ... EXCHANGE/A3 = EDIT(PHONE,'$$$999$$$$'); FLAG/A1 = IF (SALARY + BENEFITS GT 50000) AND (EXCHANGE EQ '736‘) THEN 'Y' ELSE 'N';END
Test higher-hit fields first
“I asked a fellow at hang-glider school 'How many successful jumps do you need before you graduate?'
He said, 'All of them.’ ”
Red Skelton
AVINGS: Potentially significant reduction in calculation time.S
One Liners For FOCUS Efficiency
TABLE FILE ...PRINT ... IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736' WHERE FLAG EQ 'Y‘END
TABLE FILE ...PRINT ... IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736' WHERE FLAG EQ 'Y‘END
TABLE FILE ...PRINT ... WHERE FLAG EQ 'Y‘ IF EXCHANGE EQ '736‘ IF LASTNAME EQ ‘$M$*'END
TABLE FILE ...PRINT ... WHERE FLAG EQ 'Y‘ IF EXCHANGE EQ '736‘ IF LASTNAME EQ ‘$M$*'END
Calculated first for every record -- and often false
Complicated calc done only when all other criteria pass
Do real fields first, or those most likely to eliminate records
Technique applies to fields on the same level. Higher level screens are always done first,
regardless of the order coded.
Jump to endCopyright 2007, Information Builders. Slide 19
FILE=CAR,…SEGMENT=…,SEGTYPE=S1,$FIELD=VALUE1,,A5,$FIELD=VALUE2,,A9,FIELDTYPE=I,$FIELD=VALUE3,,A2,FIELDTYPE=I,$FIELD=VALUE4,,A1,FIELDTYPE=I,$FIELD=VALUE5,,A6,$. . .
Force use of the higher-hit index
“It’s money. I remember it from when I was single.”
Billy Crystal
AVINGS: Significant reduction in data access time.S
One Liners For FOCUS Efficiency
TABLE FILE CARPRINT ... WHERE VALUE3 LT '736‘ WHERE VALUE4 EQ ‘ABC‘ WHERE VALUE2 EQ 'Y‘ END
TABLE FILE CARPRINT ... WHERE VALUE3 LT '736‘ WHERE VALUE4 EQ ‘ABC‘ WHERE VALUE2 EQ 'Y‘ END
FOCUS automatically uses the first index,
regardless of how the screens are arranged
in the TABLE
Force FOCUS to use the most valuable Index. Only you know which
one that is!
.VALUE3
Donated by Noreen Redden
CAR Master
Jump to endCopyright 2007, Information Builders. Slide 20
FILE=CAR,…SEGMENT=…,SEGTYPE=S1,$FIELD=FIELD1,,A5,$FIELD=FIELD2,,A9,FIELDTYPE=I,$. . .DBA=JOEL,$ USER=’ ‘,ACCESS=R,$ USER=TEST,ACCESS=R,RESTRICT=VALUE,
VALUE=RECORDLIMIT EQ 5,$
Build test limit right into the Master “Curious people are interesting people.
I wonder why that is.“
Bill Maher
AVINGS: No code to add, switch or comment out to do a test run.S
One Liners For FOCUS Efficiency
SET USER=TESTTABLE FILE CARPRINT ... WHERE FIELD1 LT '736‘END
SET USER=TESTTABLE FILE CARPRINT ... WHERE FIELD1 LT '736‘END
Put the RECORDLIMIT
in the DBA
Activate the limited record extraction for test
Donated by Noreen Redden
CAR Master
Jump to endCopyright 2007, Information Builders. Slide 21
FILE=CAR,SUFFIX=MSSQL
SEGMENT= . . .
FIELD=. . .,$FIELD=Order_Date, ORDERDATA, MDYY, DATE,$FIELD=Order_Month,ORDERDATA, YYM, DATE,$
Duplicate the same field in the MFD for multiple purposes(Interface-only technique)
“The prime minister held a meeting with the cabinet today. He also spoke to the bookcase and argued
with the chest of drawers.”
Ronnie Barker
AVINGS: Saves a DEFINE for sure, and maybe other coding.S
One Liners For FOCUS Efficiency
Duplicate ALIAS, different formats
Donated by Noreen Redden
CAR Master
TABLE . . .WHERE Order_Date FROM ‘01012000’BY Order_Month. . .
Want to screen on date, but sort/sum by month
Jump to endCopyright 2007, Information Builders. Slide 22
DEFINE FILE ... LASTNAME2/A1 = EDIT(LASTNAME,’$9’);END
TABLE FILE ...PRINT ... IF LASTNAME2 EQ ‘M' IF EXCHANGE EQ '736' IF FLAG EQ 'Y‘END
DEFINE FILE ... LASTNAME2/A1 = EDIT(LASTNAME,’$9’);END
TABLE FILE ...PRINT ... IF LASTNAME2 EQ ‘M' IF EXCHANGE EQ '736' IF FLAG EQ 'Y‘END
Do string manipulation inside the TABLE when possible
“I only know two pieces. One is 'Clair de Lune' and the other one isn't.”
AVINGS: In-TABLE string masking is faster than DEFINE.S
TABLE FILE ...PRINT ... IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736' IF FLAG EQ 'Y‘END
TABLE FILE ...PRINT ... IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736' IF FLAG EQ 'Y‘END
$ means any one character$* means all remaining chars
Victor Borge
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 23
Store up to 99 parsed masters in memory, so no reparsing
“It’s no longer a question of staying healthy. It’s a question of finding a sickness you like.”
Jackie Mason
Avoid reparsing Masters over and over again
SET SAVEDMASTERS = 99TABLE FILE CARPRINT …ENDTABLE FILE CAR …TABLE FILE EMPLOYEE …TABLE FILE CAR …TABLE FILE SALES …TABLE FILE EMPLOYEE …
SET SAVEDMASTERS = 99TABLE FILE CARPRINT …ENDTABLE FILE CAR …TABLE FILE EMPLOYEE …TABLE FILE CAR …TABLE FILE SALES …TABLE FILE EMPLOYEE …
Never reparses on consecutive use
Without the SET, would: -- dump CAR master,-- parse EMPLOYEE, -- reparse CAR again-- parse SALES ….
SAVINGS: Large savings when constantly flipping Masters.
born Jacob Maza
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 24
I could index SSN, but an index won’t
help on partial searches
Split a field into pieces for instantaneous searches
USE FORSocial Security NumbersPhone NumbersCredit Card NumbersHottrack Numbers (we do!)
“A boy can learn a lot from a dog: obedience, loyalty, and the importance of turning around three times
before lying down.”
Robert Benchley
AVINGS: Rock-bottom I/O when searching for that ‘field’.S
SSNSSN4TO5
SSN1TO3
SSN6TO9
SSN123-45-6789
DATA
DATA
QUESTIONHow many pages would I have to
search to find the last of 999,999,999 SSN combinations?
5Mil pages
3 pages
40 pages
1 page
Store full SSN here too
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 25
Index your HOLD file
“I’m this century’s Dennis The Menace.”
AVINGS: Slower to build extract, but much faster post-retrieval. S
Bart Simpsonborn Bartholomew Jo-Jo Simpson
TABLE FILE … PRINT CITY TITLE BY EMPL_NO ON TABLE HOLDENDTABLE FILE HOLD COUNT EMPL_NO BY TITLE IF CITY EQ ‘ORLANDO’END
FORMAT FOCUS INDEX CITY
HOLD extracts might be used more efficiently if you could index important
search fields for subsequent reports.
Sequential file sorted by
EMPL_NOFOCUS database
indexed on CITY
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 26
Build an alternate master with large alphas when you need only a few fields out of hundreds“When you go into court you are putting your fate into the hands of twelve people who weren’t smart enough
to get out of jury duty.”
Norm Crosby
AVINGS: Reduce reparsing time when non-seq but iterative usage.S
FILE=LOTSOFSEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=GHI,,F4.1 FIELD=JKL,,D12.2 FIELD=MNO,,A5
FILE=LOTSOFSEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=GHI,,F4.1 FIELD=JKL,,D12.2 FIELD=MNO,,A5
FILE=LOTSOFSEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=LAST3,,A17
FILE=LOTSOFSEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=LAST3,,A17
TABLE FILESUM ABC BY DEFEND
TABLE FILESUM ABC BY DEFEND
SEGMENT=TWO FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5 FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5 FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5
SEGMENT=TWO FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5 FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5 FIELD=PQR,,I9 FIELD=STU,,F4.1 FIELD=VWX,,D12.2 FIELD=YZA,,A5
SEGMENT=TWO FIELD=ALLONE,,A65
SEGMENT=TWO FIELD=ALLONE,,A65
.
.
.
Make sure you count the bytes
properly !!...
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 27
LOAD FOCEXEC fex_name1 fex_name2 …
LOAD FOCCOMP compiled_modify_name
EX …RUN …
LOAD FOCEXEC fex_name1 fex_name2 …
LOAD FOCCOMP compiled_modify_name
EX …RUN …
Pre-LOAD your application into memory
“If your parents never had children, chances are you won't either.“
Dick Cavett
AVINGS: Instant startup of large components. (No execution value.)S? LOAD [filetype]UNLOAD [* | filetype] [* | filename1 [filename2 …] ]
? LOAD [filetype]UNLOAD [* | filetype] [* | filename1 [filename2 …] ]
LOAD Masters and Access Files too
One Liners For FOCUS Efficiency
Uses the image now in memory
Jump to endCopyright 2007, Information Builders. Slide 28
Code for execution performance Generally, fewer lines of code means faster performance
Code for programmer performanceDon't belabor over tweaking code for one-time applications, nor spend hours speeding up something that is already quick
Code for maintenanceDon't sacrifice readability and maintainability. Remember that you or someone will have to maintain your code
Code for execution performance Generally, fewer lines of code means faster performance
Code for programmer performanceDon't belabor over tweaking code for one-time applications, nor spend hours speeding up something that is already quick
Code for maintenanceDon't sacrifice readability and maintainability. Remember that you or someone will have to maintain your code
“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but
'That's funny...‘ ”
Rob’s Rules of Coding for Performance
AVINGS: Live by the rules to save time for everyone S Donated by Rob Freeman
Isaac Asimov
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 29
I leave you with this gem
"I'd rather be a could-be if I cannot be an are; because a could-be is a maybe who is reaching for a star. I'd rather be a has-been than a might-have-been, by far;for a might-have-been has never been, but a has was
once an are."
Milton Berle
One-Liners for [Web]FOCUS Efficiency
born Milton Berlinger
One Liners For FOCUS Efficiency
Jump to endCopyright 2007, Information Builders. Slide 30
Presentation Information
Author: Joel Starkman
Company: Information Builders
Presentation Title: New One-Liners for [Web]FOCUS Efficiency
Presentation Abstract: Does your FOCUS job take hours to run, or absorb inordinate amounts of system resources, or barely fit into your nightly production window? This session presents over three dozen techniques, each virtually a minor one-line change to your focexec, that target hidden inefficiencies in your code. With a little help from history's greatest one-liner comedians, if even one tip helps you gain tremendous savings, it's worth attending this session.
Author: Joel Starkman
Company: Information Builders
Presentation Title: New One-Liners for [Web]FOCUS Efficiency
Presentation Abstract: Does your FOCUS job take hours to run, or absorb inordinate amounts of system resources, or barely fit into your nightly production window? This session presents over three dozen techniques, each virtually a minor one-line change to your focexec, that target hidden inefficiencies in your code. With a little help from history's greatest one-liner comedians, if even one tip helps you gain tremendous savings, it's worth attending this session.