Transcript Slide 1
ONE-LINERS for [Web]FOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. August, 2009 1 One-Liners For [Web]FOCUS Efficiency 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 Conclusion 2 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Prove it - How do I see these savings? -SET &STARTCPU = &FOCCPU ; TABLE, etc…. Capture CPU -RUN in-stream -SET &ENDCPU = &FOCCPU ; -SET &USED=(&ENDCPU - &STARTCPU) /1000; -TYPE Table used &USED CPU seconds Examine your post-execution operating system statistics TABLE, etc…. STATISTICS OF LAST COMMAND RECORDS LINES BASEIO SORTIO SORT PAGES READS TRANSACTIONS ACCEPTED SEGS INPUT SEGS CHNGD = = = = = = = = = = 0 0 0 0 0 0 0 0 0 0 INTERNAL MATRIX CREATED: YES SORT USED: FOCUS AGGREGATION BY EXT.SORT: NO Conclusion 3 ? STAT SEGS DELTD NOMATCH DUPLICATES FORMAT ERRORS INVALID CONDTS OTHER REJECTS CACHE READS MERGES SORT STRINGS INDEXIO = = = = = = = = = = AUTOINDEX USED: AUTOPATH USED: HOLD FROM EXTERNAL SORT: *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. 0 0 0 0 0 0 0 0 0 0 NO NO NO Use TABLEF when appropriate “I bought some batteries but they weren’t included, so I hadOne to buy them again.” Liners For FOCUS Efficiency F TABLE FILE CAR SUM DCOST BY COUNTRY BY CAR ON CAR SUBFOOT END Extract data S Steven Wright Data already sorted in the order of the report request? Use TABLEF !! Sort and Merge data Generate report You can still use COMPUTE, SUM and WHERE TOTAL AVINGS: Eliminates large cost of sorting, even if none to do. Conclusion 4 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Most of the time, you don’t need the Internal Matrix "If you live to the age of a hundred you have it made because very few people past theFor age FOCUS of a hundred.” OnedieLiners Efficiency SET SAVEMATRIX = OFF TABLE FILE CAR SUM DCOST BY COUNTRY END HOLD FORMAT EXL2K S Savematrix is OFF by default in Rel 7.2 and up, but it might be SET to ON in the site-wide profile. George Burns born Nathan Birnbaum No need to create or preserve the Internal Matrix Matrix is needed only when result is re-used. Use SAVEMATRIX=ON AVINGS: Significant cost of creating a matrix that is not used. Conclusion 5 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Use an &Variable constant instead of DEFINE “I was going to have cosmetic surgery until I noticed that the doctor's office wasLiners full of portraits by Picasso.” One For FOCUS Efficiency Recalculated for every record DEFINE FILE CAR INCR/I3 WITH DCOST = 5 ; END TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + INCR ; BY COUNTRY BY CAR END Calculated once for entire report Rita Rudner Instead: -SET &INCR = 5 ; TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + &INCR ; BY COUNTRY BY CAR END SAVINGS: Could save millions of calculations, one per record. Conclusion 6 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Don’t read the entire Flat File "My one regret in life is that I am not someone else”. One Liners For FOCUS Efficiency S Allen Beatty Bullock Denver Kidman . . Zappa Ten Records “The flat file is sorted on the screened field; stop searching when you see a larger value.” One Million Records SET FIXRETRIEVE=ON TABLE FILE NAMES PRINT NAME IF NAME LT ‘E’ END Woody Allen born Allen Stewart Konigsberg *Only for flat files AVINGS: Average 50% search time; could save 1% or 99%. Conclusion 7 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Substitute DEFINE with COMPUTE "Have you ever noticed that anybody driving slower than you is an idiot, and anyone going faster than you is One Liners For FOCUS Efficiency a maniac?” Calculation done for every record extracted DEFINE FILE CAR INCR/I7 = DCOST * 5 ; END TABLE FILE CAR SUM DCOST INCR BY COUNTRY BY CAR END S Calculation done only for each SUM’ed line on the report George Carlin Instead: TABLE FILE CAR SUM DCOST COMPUTE INCR/I7 = DCOST * 5 ; BY COUNTRY BY CAR END Careful! You cannot always substitute DEFINE with COMPUTE. AVINGS: Increases with record volume extracted and aggregated. Conclusion 8 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Do the HOLD After the END “I’m not going to buy my kids an encyclopedia. Let them walk school like OnetoLiners ForI did.” FOCUS Efficiency HOLD’ing the same results in 3 different formats? S TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS HTML END TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS EXL2K END TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS PDF END Re-extracts entire data set 3 times Instead: SET SAVEMATRIX = ON TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS HTML END HOLD AS EXL2K HOLD AS PDF Re-uses internal matrix from first to generate others AVINGS: 50% for 2 HOLD, 66% for 3 HOLDS, etc. Conclusion 9 Yogi Berra born Lawrence Peter Berra *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Reformat Fields in TABLE instead of DEFINE “The pen is mightier than the sword, and considerably easier to write with.” One Liners For FOCUS Efficiency DEFINE FILE CAR Marty Feldman -* DCOST is originally D12.2 INTCOST/I6 = DCOST ; Instead: END TABLE FILE CAR TABLE FILE CAR SUM DCOST SUM COST DCOST/I6 AS ‘INTCOST’ INTCOST BY CAR Hint: Invisible field would appear BY CAR in a HOLD file. To remove, END SET HOLDLIST=PRINTONLY END No DEFINE needed. (does create invisible field in matrix) S AVINGS: Only final displayed field is reformatted. Conclusion 10 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Flip to Alternate File View to elevate screening criteria “Beauty may be skin deep, but ugly goes clear to the bone.” One Liners For FOCUS Efficiency CAR N E MODEL TABLE.DCOST FILE CAR CAR PRINT MODEL DCOST IF DCOST GE 20000 END COUNTRY MODEL R S Redd Foxx born John Elroy Sanford CAR T DCOST BODY DCOST COUNTRY I BODY MODEL O Why follow pointers all the way to the bottom, just to find that a DCOST does not fit the criteria? BODY COUNTRY DCOST P SAVINGS: Tremendous reductions in I/O and response time. Conclusion 11 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Use Indexed File View to elevate screening criteria “I don’t like watching golf on TV. I can’t stand whispering.” One Liners For FOCUS CAR N E TABLE.DCOST FILE CAR CAR PRINT MODEL DCOST IF DCOST GE 20000 END COUNTRY MODEL R S MODEL CAR T DCOST David Brenner BODY DCOST COUNTRY I BODY MODEL O Same dot-syntax as alternate view; uses index automatically when present. BODY COUNTRY DCOST P Efficiency SAVINGS: Tremendous reductions in I/O and response time. Conclusion 12 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Let your Sort Utility do the work – and not just the sorting! “We spend the first twelve months of our children’s lives teaching them toOne walkLiners and talk,For and the next twelve FOCUS Efficiency telling them to sit down and shut up.” FOCUS Sort Phyllis Diller born Phyllis Ada Driver SET EXTSORT=ON SET EXTAGGR=ON SET EXTHOLD=ON System Sort SYNCSORT DFSORT VMSORT HOLD File S AVINGS: Tremendous reductions in sort time and data movement. Conclusion 13 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Presort data before MODIFY FIXFORM “I’m the kind of guy who will have nothing all my life and then they’ll discover oil Liners while digging my grave.”Efficiency One For FOCUS E H F G D Unsorted Sorted D E F G H George Gobel A B Page 1 C D P a g e 2E F G Page 3 H I Call system sort MODIFY FILE … FIXFORM keyfield MATCH keyfield ON NOMATCH UPDATE DATA ON … Sort the data file first SAVINGS: Could be 100’s of times faster on large volumes. Conclusion 14 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. J Page 4 Extract once to HOLD, then multiple TABLEs “I have six locks on my door. When I go out, I lock every other one. I figure matter how somebody OnenoLiners Forlong FOCUS Efficiency tries to pick the locks, they are always locking three.” TABLE FILE HUGE SUM … IF REGION EQ ‘NORTH’ OR ‘SOUTH’ OR ‘EAST’ OR ‘WEST’ ON TABLE HOLD END Another One-Liner Solution: TABLE FILE HUGE SUM … IF REGION EQ ‘NORTH’ END TABLE FILE HUGE SUM … IF REGION EQ ‘SOUTH’ END TABLE FILE HUGE SUM … IF REGION EQ ‘EAST’ END TABLE FILE HUGE SUM … IF REGION EQ ‘WEST’ END Elayne Boosler Why extract the entire database four times? SAVINGS: Spend a little, get a lot, when high degree of aggregation. (see next slide) Conclusion 15 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Use POOLED TABLES for multiple TABLEs “Always get married in the morning. That way if it doesn’t work out, you haven’t wasted whole day.” One Liners FortheFOCUS Efficiency TABLE FILE HUGE SUM … IF REGION EQ ‘NORTH’ SET POOL= ON END TABLE FILE HUGE • No HOLD file needed SUM … • Extracts from database once IF REGION EQ ‘SOUTH’ END • Feeds all TABLEs at one time TABLE FILE HUGE • Output identical to no pooling SUM … REGION EQ ‘EAST’ • Set ESTLINES/ESTRECORDS IF END for even more efficiency TABLE FILE HUGE SET POOL= OFF SUM … IF REGION EQ ‘WEST’ Note: Pooled Tables is a chargeable feature. END SAVINGS: 1/n SET POOLFEATURE=ON in FOCPARM th Conclusion 16 of I/O’s where n is number of TABLES. *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Mickey Rooney born Joseph Yule, Jr. Why extract the entire database four times? REBUILD without the Index first "I know a man who is a diamond cutter. He mows the lawn at Yankee Stadium”. One Liners For FOCUS Efficiency FILE = … SEGMENT = … FIELD=ABC,,I5, FIELDTYPE=I ,$ FIELD=DEF,,A12,$ FIELD=GHI,,D12.2, FIELDTYPE=I ,$ FIELD=JKL,,F5,$ S 1. 2. 3. 4. Henny Youngman Remove indexes and save as alternate master REBUILD REBUILD with no-index master Put back original master with indexes REBUILD INDEX AVINGS: Usually measured in hours of elapsed time. Conclusion 17 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Eliminate 1000’s of REBUILD messages “I set records that will never be equaled. In fact, I hope 90% of them don’tLiners ever getFor printed.” One FOCUS Efficiency SET REBUILDMSG = 100000 REBUILD REORG DUMP or LOAD … (Default is 1000) CAR FOCUS A1 ON 09/23/2005 AT 16.19.05 REFERENCE...AT TRANS 100000 REFERENCE...AT TRANS 200000 REFERENCE...AT TRANS 300000 TRANSACTIONS: TOTAL =302000 ACCEPTED=302000 SEGMENTS: INPUT =302000 UPDATED = 0 Bob Uecker REJECTED= DELETED = 0 0 SAVINGS: On large files, millions of JES bytes; save forests if printed Conclusion 18 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Reduce MODIFY update notices “I found the secret to the work week. I’ve convinced myself that everything after MondayFor is almost Friday.” One Liners FOCUS Efficiency MODIFY FILE CAR Default: write to FIXFORM database every MATCH field 1000 records (1 for CRTFORM) ON MATCH REJECT ON NOMATCH INCLUDE Or just DATA ON file CHECK OFF CHECK 99999 Hint:Midstream recovery? END Use “START &TRANS” SAVINGS: Large I/O savings on bulk loads. Conclusion 19 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Joel Starkman Hey! Who’s this guy? JOIN in the faster direction “I find television very educating. Every time somebody turns on the set,One I go into the other and Efficiency Liners For room FOCUS read a book.” Diego Alcazar Lorenzo Alcazar Nicolas Cassadine Carly Corinthos Michael Corinthos, III Sonny Corinthos Alexis Davis Noah Drake Patrick Drake Jasper "Jax" Jacks Georgie/Maxie Jones Ric Lansing Reese Marshall Samantha McCall Jason Morgan Dillon Quartermaine Edward Quartermaine Tracy Quartermaine Skye Quartermaine Emily Quartermaine Dr. Alan Quartermaine Dr. Monica Quartermaine Malcolm ‘Mac’ Scorpio Robert Scorpio Dr. Robin Scorpio Bobbie Spencer Elizabeth Spenser Lucky/Lulu Spencer Luke Spencer Lainey Winters Operator President Vice President Manager A1 Operator Operator C2 TABLE FILE Operator President President C2 PRINT NAME Technical Secretary B3 WHERE BLDG IS ‘C2’ Manager born Julius Henry Marx Technical C2 Operator END President Vice Pres A1 Operators Technical Operator Operator Technical Technical Manager Operator Secretary Manager Vice President FILE=GH FILE=JOB Technical Manager SEGMENT=GH1, … SEGMENT=JOB1, … Technical FIELD=NAME, … FIELD=POS, …, INDEX=I,$ Technical Secretary FIELD=POS, …INDEX=I,$ FIELD=BLDG, … Secretary … … Operators President Technical ???? JOB Groucho Marx JOIN POS IN GH TO POS IN JOB JOIN POS IN JOB TO POS IN GH SAVINGS: Could reduce processing time by 90% or more. Conclusion 20 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Build your own External Index when you don’t have write access to the file “Zsa Zsa Gabor got married as a one-off, and it was so successful she turned it into a series.” One Liners For FOCUS Efficiency One Million Records S AHP FGJH IDSA JSDQR LFS ZWIO F J E W Z E X T E R N A L I N D E X A A A C D D E F H H H J . . . . U W X Y Z Z >> rebuild ENTER OPTION External index NEW OR ADD TO EXISTING? Bob Hope born Leslie Towne Hope ... # Build your External Index is static; must rebuild if file changes. own index# USE mastername extindexname INDEX mastername END TABLE FILE filename .indexfield H AVINGS: Could reduce data accessing time by 90% or more. Conclusion 21 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Index Your HOLD File “I’m this century’s Dennis The Menace.” One Liners For FOCUS Efficiency HOLD extracts might be used more efficiently if you could index important search fields for subsequent reports. Bart Simpson born Bartholomew Jo-Jo Simpson TABLE FILE … Sequential file FOCUS database sorted by PRINT CITY TITLE indexed on EMPL_NO CITY BY EMPL_NO ON TABLE HOLD FORMAT FOCUS INDEX CITY END TABLE FILE HOLD COUNT EMPL_NO BY TITLE IF CITY EQ ‘ORLANDO’ END SAVINGS: Slower to build extract, but much faster post-retrieval. Conclusion 22 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. JOIN WHERE - when two files have nothing in common! “With kids, the days are long, but the years are short.” One Liners For FOCUS Efficiency Which employees can afford to buy a BMW? JOIN FILE CAR AT RETAIL_COST TO ALL FILE EMPLOYEE AT CURR_SAL AS CAREMP John Leguizamo WHERE CURRSAL GT (RETAIL_COST * 3); Interpretation: You have to earn at least $90,000 to afford a car of $30,000. Example only; not the opinion of the presenter or Information Builders END TABLE FILE CAR PRINT FIRSTNAME LASTNAME BY CAR JOIN files IF CAR EQ ‘BMW' on any fields CAR FIRSTNAME LASTNAME END ----BMW S --------JOHN JOAN BARBARA -------BANNING IRVING CROSS without indexes AVINGS: Actually slow, but tough to code many scenarios without it Conclusion 23 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. BY TOTAL – Sort by computed columns in one pass “When I see the Ten Most Wanted Lists, I always have this thought: If we’d made feelFor wanted earlier, they One them Liners FOCUS Efficiency wouldn’t be wanted now.” Sort by Average Sales* COUNTRY CAR AVE SALES SALES ENGLAND JENSEN 17650 73000 TRIUMPH 24200 122000 JAPAN HONDA 17480 235000 18250 197300 TABLE FILE TOYOTA CAR Eddie Cantor born Edward Israel Iskowitz No HOLD ! SUM SALES AVE.SALES BY COUNTRY BY CAR BY AVE.SALES TABLE FILE CAR SUM SALES ON TABLE HOLD BY COUNTRY BY CAR END TABLE FILE HOLD BY TOTAL AVE.SALES SUM E03 BY COUNTRY BY CAR END BY E04 AS ‘Ave Sales’’ END SAVINGS: Eliminates second pass of the data – could be 50%. Conclusion 24 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. *Invented numbers Test Higher-Hit Fields First “If your ship doesn’t come in, swim out to it.” One Liners For FOCUS Efficiency DEFINE FILE ... EXCHANGE/A3 = EDIT(PHONE,'$$$999$$$$'); FLAG/A1 = IF (SALARY + BENEFITS GT 50000) Jonathan Winters AND (EXCHANGE EQ '736‘) THEN 'Y' ELSE 'N'; Do real fields first, END Calculated first or those most likely for every record TABLE FILE ...- and often false TABLE FILE ...to eliminate records PRINT ... PRINT ... WHERE FLAG EQ 'Y‘ IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736‘ IF EXCHANGE EQ '736' IF LASTNAME EQ ‘$M$*' WHERE FLAG EQ 'Y‘ END END Complicated calc Technique applies to fields on the same level. Higher level screens are always done first, regardless of the order coded. done only when all other criteria pass SAVINGS: Potentially significant reduction in calculation time. Conclusion 25 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Do String Manipulation Inside the TABLE When Possible “????.” One Liners For FOCUS Efficiency $ means any one character $* means all remaining chars Marcel Marceau DEFINE FILE ... born Marcel Mangel LASTNAME2/A1 = EDIT(LASTNAME,’$9’); END TABLE FILE ... TABLE FILE ... PRINT ... PRINT ... IF LASTNAME2 EQ ‘M' IF LASTNAME EQ ‘$M$*' IF EXCHANGE EQ '736' IF EXCHANGE EQ '736' IF FLAG EQ 'Y‘ IF FLAG EQ 'Y‘ END END SAVINGS: In-TABLE string manipulation is faster than DEFINE. Conclusion 26 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Replace Compound-IF in DEFINE with “WHERE” “When I was born my father spent three weeks trying to find a loophole in my birth certificate.” One Liners For FOCUS Efficiency DEFINE FILE ... TESTFIELD/A1 = IF (F1 EQ ‘ABC’) OR (F2 GE 27) THEN ‘Y’ ELSE ‘N’ ; END TABLE FILE ... IF TESTFIELD EQ ‘Y' Instead: END TABLE FILE ... Must use WHERE, not IF, in this compound situation Jackie Vernon WHERE (F1 EQ ‘ABC’) OR (F2 GE 27) END SAVINGS: WHERE is much faster than compound-IF in DEFINE Conclusion 27 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Avoid reparsing Masters over and over again “It’s no longer a question of staying healthy. It’s a question of finding a sickness you like.” One Liners For FOCUS Efficiency Store up to 99 parsed masters in memory, so no reparsing SET SAVEDMASTERS = 99 TABLE FILE CAR PRINT … END TABLE FILE CAR … TABLE FILE EMPLOYEE … TABLE FILE CAR … TABLE FILE SALES … TABLE FILE EMPLOYEE … Jackie Mason born Jacob Maza Never reparses on consecutive use Without the SET, would: -- dump CAR master, -- parse EMPLOYEE, -- reparse CAR again -- parse SALES …. SAVINGS: Large savings when a user constantly flips Masters. Conclusion 28 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Split a field into pieces for instantaneous searches “Fame comes with its own standards. A guy who twitches his lips is just another guyFor withFOCUS a lip twitchEfficiency – One Liners unless he’s Humphrey Bogart.” SSN 123-45-6789 SSN QUESTION SSN1TO3 How many pages would I have to search to find the last of 999,999,999 SSN combinations? SSN4TO5 DATA Sammy Davis Jr. I could index SSN, but an index won’t help on partial searches SSN6TO9 Social Security Numbers Phone Numbers Credit Card Numbers Hottrack Numbers (we do!) Store full SSN here too DATA SAVINGS: Rock-bottom paging I/O when screening on that field. Conclusion 29 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. 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 enough One Liners For smart FOCUS Efficiency to get out of jury duty.” FILE=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=GHI,,F4.1 FIELD=JKL,,D12.2 FIELD=MNO,,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 FILE=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=LAST3,,A17 SEGMENT=TWO Norm Crosby ! Make sure you count the bytes properly FIELD=ALLONE,,A65 . . . TABLE FILE SUM ABC BY DEF . . END . AVINGS: Reduce reparsing time when non-seq but iterative usage. S Conclusion 30 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Display the number of the last page (Finally!) “A girl phoned me the other day and said ‘Come on over, there’s nobody home’. For I went over. One Liners FOCUS Efficiency Nobody was home.” TABLE FILE CAR HEADING "PAGE <TABPAGENO OF <TABLASTPAGE </1" SUM DCOST BY COUNTRY PAGE-BREAK ON TABLE HOLD FORMAT HTML ON TABLE SET STYLE * TYPE=REPORT,FONT=ARIAL,$ ENDSTYLE END Notes: &FOCNEXTPAGE is set to TABLASTPAGE Supported for FORMAT HTML/PDF/PS only Rodney Dangerfield born Jacob Cohen Page 4 of 4 Page 3 of 4 Page 2 of 4 Page 1 of 4 REPORT SAVINGS: Internally still two passes – mostly for coding simplicity Conclusion 31 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. EDIT is faster than comparable subroutines “The guy who invented the first wheel was an idiot. The guy who invented the other three –For he was a genius.” One Liners FOCUS Efficiency Extract the exchange DEFINE/COMPUTE PHONE/A12 = ‘123-567-9012’; Sid Caesar born Isaac Sidney Caesar EXCH/A3 = EDIT (PHONE, ‘$$$$999’) ; EXCH/A3 = SUBSTR (12, PHONE, 5, 7, 3, EXCH) ; EXCH/A3 = GETTOK (PHONE, 12, 2, ’-’, 3, EXCH) ; EDIT does not apply to all situations of partial extractions SAVINGS: 25-50% directly attributable to those calculations. Conclusion 32 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Minimize test-run time during development "I think I did pretty well, considering I started out with nothing butOne a bunch of blank paper”. Liners For FOCUS Efficiency Stop retrieval after the nth satisfying record Generally for Developers to quick-test code Easy to turn on and off; ignored in Production Steve Martin -DEFAULT &1 = ‘ ‘ -SET &&IFRECORDLIMIT = IF &1 NE ‘TEST’ THEN ‘ ‘ ELSE ‘IF RECORDLIMIT EQ 1’ ; TABLE FILE … EX focexecname TEST PRINT … BY … Parameter &1 of call &&IFRECORDLIMIT Hint: Use global && END Set once for entire application. SAVINGS: Cut 99.9% of runtime (during testing). &&IFRECORDLIMIT is NOT a reserved variable; could be any name. Conclusion 33 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Pre-LOAD Your Application into Memory “When I adlib something, I laugh for the same reason the audience does;One I’ve never heard thatFOCUS joke before Liners For Efficiency and I’m just as surprised as they are.” LOAD FOCEXEC fex_name1 fex_name2 … LOAD FOCCOMP compiled_modify_name EX … RUN … Steve Allen LOAD Masters and Access Files too Uses the image now in memory ? LOAD [filetype] UNLOAD [* | filetype] [* | filename1 [filename2 …] ] SAVINGS: Instant startup of large components. (No execution value.) Conclusion 34 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Use –REPEAT instead of –IF loop Randolph Duke: “Mother always said you were greedy.” Mortimer Duke: “She meant it as a complement.” One Liners For FOCUS Efficiency Trading Places -SET &CNT = 0 ; Hint: Use -LOOPTOP &’s to vary Ralph -SET &CNT = &CNT + 1 ; Don the range TABLE, MODIFY, etc. dynamically Bellamy Ameche PRINT FIELD&CNT … -IF &CNT LE 10 GOTO LOOPTOP; Instead: -AFTERLOOP -REPEAT LOOP FOR &CNT FROM 1 TO 10 TABLE, MODIFY, etc. PRINT FIELD&CNT … Easier to code than Other options: “increment/check”. -LOOP S Can decrement. Can be negative. -REPEAT label n TIMES -REPEAT label WHILE condition AVINGS: Minor, yet far more readable code. Conclusion 35 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Capture FOCUS Commands and Statistics with FOCLOG “As a child my family’s menu consisted of two choices: take it orLiners leave it.” One For FOCUS Efficiency ind applications and focexecs that could significantly benefit from adjustment, consolidation, redesign. versee how much FOCUS is being used at your site. Buddy Hackett born Leonard Hacker hart interactive activity versus batch activity across all LPARs. ocate excessive or misguided use by measuring CPU, paper output, extract files, session length, frequency, repetition, .... bserve how data is used by identifying the most popular extract destinations via HOLD (like HTML, Excel 2000, PDF). raph patterns and trends of usage across any time period. SAVINGS: Could be immense based on analysis of usage data. *FOCLOG is a chargeable product. See your local IBI Representative. Conclusion 36 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. One-Liners for [Web]FOCUS Efficiency "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; One Liners For FOCUS Efficiency for a might-have-been has never been, but a has was once an are." Milton Berle born Milton Berlinger I leave you with this gem Conclusion 37 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 38 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Presentation Information Author: Joel Starkman Company: Information Builders Presentation Title: 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. Conclusion 39 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. One-Liners For [Web]FOCUS Efficiency Conclusion 40 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. One-Liners For [Web]FOCUS Efficiency Conclusion 41 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. One-Liners For [Web]FOCUS Efficiency Conclusion 42 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders.