Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ONE-LINERS for [Web]FOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. August, 2009 When Printing Handouts.

Similar presentations


Presentation on theme: "1 ONE-LINERS for [Web]FOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. August, 2009 When Printing Handouts."— Presentation transcript:

1 1 ONE-LINERS for [Web]FOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. August, 2009 When Printing Handouts USE “Pure Black and White” not “Grayscale” Otherwise, all of the reverse-color text will not show up. ONE-LINERS for [Web]FOCUS Efficiency This box exists only to allow you to access this outlying region of the screen where the above movement arrow line is visible when you click on Custom Animation of the picture at left of screen. This block of pictures streams across the screen repeatedly. Note the move-right Animation effect (dotted line with arrow on each end). Pre-Music - start it and stop it Click on the Music (speaker) icon the start the music. The description text Appears on that click also, as does the Stop icon. Click on the Stop icon to stop the music. The stop works by Action Setting Hyperlinking to the First Slide, which is itself (very cool). The description text Disappears on that click also, as does the Stop icon. Click anywhere else to proceed to the next slide.

2 2 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 The CPU TIME is actually two halves, oppositely cropped and re-attached, so that the bottom half can “fall off” in time with the scissor reaching the left side. Under them is a duplicate of the whole word with no background color; it gets exposed when the bottom half falls off to leave behind a “shadow” of the bottom half. Since the checkmark is used as a ‘theme’ on every subsequent slide, it is emphasized here by shrinking it into the bullets (in time with the Wiping of the bullet list).

3 3 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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/ MATCH MODIFY/ MAINTAIN MODIFY/ MAINTAIN Capture CPU in-stream TABLE, etc…. ? STAT Examine your post-execution operating system statistics

4 4 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Data already sorted in the order of the report request? Use TABLEF !! “I bought some batteries but they weren’t included, so I had to buy them again.” Steven Wright Use TABLEF when appropriate TABLE FILE CAR SUM DCOST BY COUNTRY BY CAR ON CAR SUBFOOT END TABLE FILE CAR SUM DCOST BY COUNTRY BY CAR ON CAR SUBFOOT END Extract data Sort and Merge data Generate report You can still use COMPUTE, SUM and WHERE TOTAL F AVINGS: Eliminates large cost of sorting, even if none to do. S ALL SUBSEQUENT SLIDES The white area (actually a freeform-line region) at the top of each slide covers a comedian’s picture and one-liner - - needed so they do not appear on handouts. The white box itself never appears during the presentation because the first animation on each slide is to remove it. ALL SUBSEQUENT SLIDES Most slides attempt to draw attention to the key item, letter, word, line, etc. by differentiating its color and/or size, and/or by animating it. When it is underlined too, it is totally for the benefit of the handout which cannot see these effects (except size). ALL SUBSEQUENT SLIDES Objects on most slides use consistent coloration effects. Code samples and boxes of diagrams usually use the gray Texture. Informational boxes use either a light blue (or blue-red) Texture, or a deep blue color either solid if small or shaded if larger. One Liners For FOCUS Efficiency WHITE BOX EXPLANATION

5 5 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion "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 Most of the time, you don’t need the Internal Matrix SET SAVEMATRIX = OFF TABLE FILE CAR SUM DCOST BY COUNTRY END HOLD FORMAT EXL2K SET SAVEMATRIX = OFF TABLE FILE CAR SUM DCOST BY COUNTRY END HOLD FORMAT EXL2K No need to create or preserve the Internal Matrix Matrix is needed only when result is re-used. Use SAVEMATRIX=ON Savematrix is OFF by default in Rel 7.2 and up, but it might be SET to ON in the site-wide profile. AVINGS: Significant cost of creating a matrix that is not used. S born Nathan Birnbaum One Liners For FOCUS Efficiency

6 6 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “I was going to have cosmetic surgery until I noticed that the doctor's office was full of portraits by Picasso.” Rita Rudner Use an &Variable constant instead of DEFINE DEFINE FILE CAR INCR/I3 WITH DCOST = 5 ; END TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + INCR ; BY COUNTRY BY CAR END DEFINE FILE CAR INCR/I3 WITH DCOST = 5 ; END TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + INCR ; BY COUNTRY BY CAR END - SET &INCR = 5 ; TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + &INCR ; BY COUNTRY BY CAR END - SET &INCR = 5 ; TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + &INCR ; BY COUNTRY BY CAR END Recalculated for every record Calculated once for entire report S AVINGS: Could save millions of calculations, one per record. One Liners For FOCUS Efficiency Instead:

7 7 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion "My one regret in life is that I am not someone else”. Woody Allen Don’t read the entire Flat File Allen Beatty Bullock Denver Kidman. 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’ END One Million Records Ten Records *Only for flat files 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.” born Allen Stewart Konigsberg One Liners For FOCUS Efficiency

8 8 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion "Have you ever noticed that anybody driving slower than you is an idiot, and anyone going faster than you is a maniac?” George Carlin Substitute DEFINE with COMPUTE DEFINE FILE CAR INCR/I7 = DCOST * 5 ; END TABLE FILE CAR SUM DCOST INCR BY COUNTRY BY CAR END TABLE FILE CAR SUM DCOST COMPUTE INCR/I7 = DCOST * 5 ; BY COUNTRY BY CAR END Calculation done for every record extracted AVINGS: Increases with record volume extracted and aggregated. S One Liners For FOCUS Efficiency Careful! You cannot always substitute DEFINE with COMPUTE. Instead: Calculation done only for each SUM’ed line on the report

9 9 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “I’m not going to buy my kids an encyclopedia. Let them walk to school like I did.” Yogi Berra Do the HOLD After the END 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 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 SET SAVEMATRIX = ON TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS HTML END HOLD AS EXL2K HOLD AS PDF SET SAVEMATRIX = ON TABLE FILE CAR PRINT COUNTRY CAR ON TABLE HOLD AS HTML END HOLD AS EXL2K HOLD AS PDF HOLD’ing the same results in 3 different formats? AVINGS: 50% for 2 HOLD, 66% for 3 HOLDS, etc. S Re-uses internal matrix from first to generate others Re-extracts entire data set 3 times born Lawrence Peter Berra One Liners For FOCUS Efficiency Instead:

10 10 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “The pen is mightier than the sword, and considerably easier to write with.” Marty Feldman Reformat Fields in TABLE instead of DEFINE DEFINE FILE CAR -* DCOST is originally D12.2 INTCOST/I6 = DCOST ; END TABLE FILE CAR SUM COST INTCOST BY CAR END DEFINE FILE CAR -* DCOST is originally D12.2 INTCOST/I6 = DCOST ; END TABLE FILE CAR SUM COST INTCOST BY CAR END TABLE FILE CAR SUM DCOST DCOST/I6 AS ‘INTCOST’ BY CAR END TABLE FILE CAR SUM DCOST DCOST/I6 AS ‘INTCOST’ BY CAR END No DEFINE needed. (does create invisible field in matrix) Hint: Invisible field would appear in a HOLD file. To remove, SET HOLDLIST=PRINTONLY AVINGS: Only final displayed field is reformatted. S One Liners For FOCUS Efficiency Instead:

11 11 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion COUNTRY CAR MODEL BODY DCOST “Beauty may be skin deep, but ugly goes clear to the bone.” Redd Foxx Flip to Alternate File View to elevate screening criteria COUNTRY CAR MODEL BODY DCOST COUNTRY CAR MODEL BODY DCOST Why follow pointers all the way to the bottom, just to find that a DCOST does not fit the criteria? TABLE FILE CAR PRINT MODEL DCOST IF DCOST GE END TABLE FILE CAR PRINT MODEL DCOST IF DCOST GE END.DCOST POINTERSPOINTERS Lots of coordinated transitions on this slide. The hierarchy rotates 180 o and moves right while the dotted line WIPEs on to follow it, and the TABLE slides left at the same time. Then the inverted permanent object appears directly on top. If I didn’t do that, this inverted image would not appear on the printed handout. The “.DCOST” is positioned to appear where it should be once the TABLE slides left. But on the slide and hardcopy, it does appear in the ‘wrong’ place; can’t figure an easy way around that. BODY MODEL CAR COUNTRY DCOST AVINGS: Tremendous reductions in I/O and response time. S born John Elroy Sanford One Liners For FOCUS Efficiency

12 12 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion COUNTRY CAR MODEL BODY DCOST “I don’t like watching golf on TV. I can’t stand whispering.” Use Indexed File View to elevate screening criteria COUNTRY CAR MODEL BODY DCOST COUNTRY CAR MODEL BODY DCOST Same dot-syntax as alternate view; uses index automatically when present. TABLE FILE CAR PRINT MODEL DCOST IF DCOST GE END TABLE FILE CAR PRINT MODEL DCOST IF DCOST GE END.DCOST POINTERSPOINTERS Lots of coordinated transitions on this slide. The hierarchy rotates 180 o and moves right while the dotted line WIPEs on to follow it, and the TABLE slides left at the same time. Then the inverted permanent object appears directly on top. If I didn’t do that, this inverted image would not appear on the printed handout. The “.DCOST” is positioned to appear where it should be once the TABLE slides left. But on the slide and hardcopy, it does appear in the ‘wrong’ place; can’t figure an easy way around that. BODY MODEL CAR COUNTRY DCOST AVINGS: Tremendous reductions in I/O and response time. S David Brenner One Liners For FOCUS Efficiency

13 13 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion System Sort SYNCSORT DFSORT VMSORT “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 the work – and not just the sorting! HOLD File FOCUS Sort SET EXTSORT=ON SET EXTAGGR=ON SET EXTHOLD=ON S AVINGS: Tremendous reductions in sort time and data movement. born Phyllis Ada Driver One Liners For FOCUS Efficiency

14 14 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “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 data before MODIFY FIXFORM A BCDEDEF GHIJIJ EHFGDEHFGD Unsorted MODIFY FILE … FIXFORM keyfield MATCH keyfield ON NOMATCH UPDATE DATA ON … Sort the data file first P a g e 1P a g e 2P a g e 3P a g e 4 “If it’s not ahead of me, I have to start from the top.” - FOCUS S AVINGS: Could be 100’s of times faster on large volumes. Call system sort DEFGHDEFGH Sorted One Liners For FOCUS Efficiency

15 15 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 no matter how long somebody tries to pick the locks, they are always locking three.” Elayne Boosler 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 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 TABLE FILE HUGE SUM … IF REGION EQ ‘NORTH’ OR ‘SOUTH’ OR ‘EAST’ OR ‘WEST’ ON TABLE HOLD END TABLE FILE HUGE SUM … IF REGION EQ ‘NORTH’ OR ‘SOUTH’ OR ‘EAST’ OR ‘WEST’ ON TABLE HOLD END HOLD Why extract the entire database four times? S AVINGS: Spend a little, get a lot, when high degree of aggregation. Another One-Liner Solution: (see next slide) One Liners For FOCUS Efficiency

16 16 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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/n th of I/O’s where n is number of TABLES. S 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 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 Why extract the entire database four times? SET POOL= ON SET 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. SET POOLFEATURE=ON in FOCPARM This slide must follow the previous slide, since that one has a reference to this slide as “see next slide”. I also slowed the Slide Transition to Medium to ensure the effect of leaving the one box initially. born Joseph Yule, Jr. One Liners For FOCUS Efficiency

17 17 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion "I know a man who is a diamond cutter. He mows the lawn at Yankee Stadium”. 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 master 2.REBUILD REBUILD with no-index master 3.Put back original master with indexes 4.REBUILD INDEX AVINGS: Usually measured in hours of elapsed time. S One Liners For FOCUS Efficiency

18 18 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “I set records that will never be equaled. In fact, I hope 90% of them don’t ever get printed.” Bob Uecker Eliminate 1000’s of REBUILD messages SET REBUILDMSG = REBUILD REORG DUMP or LOAD … SET REBUILDMSG = REBUILD REORG DUMP or LOAD … CAR FOCUS A1 ON 09/23/2005 AT REFERENCE...AT TRANS REFERENCE...AT TRANS REFERENCE...AT TRANS TRANSACTIONS: TOTAL = ACCEPTED= REJECTED= 0 SEGMENTS: INPUT = UPDATED = 0 DELETED = 0 AVINGS: On large files, millions of JES bytes; save forests if printed S One Liners For FOCUS Efficiency (Default is 1000)

19 19 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “I found the secret to the work week. I’ve convinced myself that everything after Monday is almost Friday.” Joel Starkman Reduce MODIFY update notices Hey! Who’s this guy? MODIFY FILE CAR FIXFORM MATCH field ON MATCH REJECT ON NOMATCH INCLUDE DATA ON file CHECK END MODIFY FILE CAR FIXFORM MATCH field ON MATCH REJECT ON NOMATCH INCLUDE DATA ON file CHECK END Default: write to database every 1000 records (1 for CRTFORM) Or just CHECK OFF Hint:Midstream recovery? Use “START &TRANS” S AVINGS: Large I/O savings on bulk loads. One Liners For FOCUS Efficiency

20 20 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion “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=JOB SEGMENT=JOB1, … FIELD=POS, …, INDEX=I,$ FIELD=BLDG, … … FILE=JOB SEGMENT=JOB1, … FIELD=POS, …, INDEX=I,$ FIELD=BLDG, … … Diego AlcazarOperator Lorenzo AlcazarPresident Nicolas CassadineVice President Carly CorinthosOperator Michael Corinthos, IIIOperator Sonny CorinthosPresident Alexis DavisTechnical Noah DrakeManager Patrick DrakeOperator Jasper "Jax" JacksPresident Georgie/Maxie JonesOperators Ric LansingTechnical Reese MarshallOperator Samantha McCallOperator Jason MorganTechnical Dillon QuartermaineTechnical Edward QuartermaineManager Tracy QuartermaineOperator Skye QuartermaineSecretary Emily QuartermaineManager Dr. Alan QuartermaineVice President Dr. Monica QuartermaineTechnical Malcolm ‘Mac’ ScorpioManager Robert ScorpioTechnical Dr. Robin ScorpioTechnical Bobbie SpencerSecretary Elizabeth SpenserSecretary Lucky/Lulu SpencerOperators Luke SpencerPresident Lainey WintersTechnical JOIN POS IN GH TO POS IN JOB FILE=GH SEGMENT=GH1, … FIELD=NAME, … FIELD=POS, …INDEX=I,$ … FILE=GH SEGMENT=GH1, … FIELD=NAME, … FIELD=POS, …INDEX=I,$ … TABLE FILE ???? PRINT NAME WHERE BLDG IS ‘C2’ END TABLE FILE ???? PRINT NAME WHERE BLDG IS ‘C2’ END ManagerA1 OperatorC2 PresidentC2 SecretaryB3 TechnicalC2 Vice PresA1 JOIN POS IN JOB TO POS IN GH JOB S AVINGS: Could reduce processing time by 90% or more. born Julius Henry Marx One Liners For FOCUS Efficiency On this slide only, the check Spirals In instead of Faded Zoom and is not last to appear.

21 21 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion >> rebuild ENTER OPTION External index NEW OR ADD TO EXISTING?... - AHPF - FGJHJ IDSAE JSDQRW LFSZ - ZWIOH AAACDDEFHHHJ....UWXYZZAAACDDEFHHHJ....UWXYZZ One Million Records S AVINGS: Could reduce data accessing time by 90% or more. EXTERNALINDEXEXTERNALINDEX “Zsa Zsa Gabor got married as a one-off, and it was so successful she turned it into a series.” Bob Hope Build your own External Index when you don’t have write access to the file Arrows are drawn With Previous at 0.1 sec delay sequentially. USE mastername extindexname INDEX mastername END TABLE FILE filename.indexfield Non-writeable file, no index Build your own index # # External Index is static; must rebuild if file changes. born Leslie Towne Hope One Liners For FOCUS Efficiency

22 22 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Index Your HOLD File “I’m this century’s Dennis The Menace.” AVINGS: Slower to build extract, but much faster post-retrieval. S Bart Simpson born Bartholomew Jo-Jo Simpson TABLE FILE … PRINT CITY TITLE BY EMPL_NO ON TABLE HOLD END TABLE 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_NO FOCUS database indexed on CITY One Liners For FOCUS Efficiency

23 23 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion JOIN files on any fields without indexes JOIN WHERE - when two files have nothing in common! S AVINGS: Actually slow, but tough to code many scenarios without it “With kids, the days are long, but the years are short.” John Leguizamo CAR FIRSTNAME LASTNAME BMW JOHN BANNING JOAN IRVING BARBARA CROSS CAR FIRSTNAME LASTNAME BMW JOHN BANNING JOAN IRVING BARBARA CROSS Which employees can afford to buy a BMW? JOIN FILE CAR AT RETAIL_COST TO ALL FILE EMPLOYEE AT CURR_SAL AS CAREMP WHERE CURRSAL GT (RETAIL _ COST * 3); END TABLE FILE CAR PRINT FIRSTNAME LASTNAME BY CAR IF CAR EQ ‘BMW' END 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 One Liners For FOCUS Efficiency

24 24 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion BY TOTAL – Sort by computed columns in one pass AVINGS: Eliminates second pass of the data – could be 50%. S “When I see the Ten Most Wanted Lists, I always have this thought: If we’d made them feel wanted earlier, they wouldn’t be wanted now.” Eddie Cantor Sort by Average Sales * COUNTRY CAR AVE SALES SALES ENGLAND JENSEN TRIUMPH JAPAN HONDA TOYOTA Sort by Average Sales * COUNTRY CAR AVE SALES SALES ENGLAND JENSEN TRIUMPH JAPAN HONDA TOYOTA TABLE FILE CAR SUM SALES AVE.SALES BY COUNTRY BY CAR ON TABLE HOLD END TABLE FILE HOLD SUM E03 BY COUNTRY BY CAR BY E04 AS ‘Ave Sales’’ END TABLE FILE CAR SUM SALES AVE.SALES BY COUNTRY BY CAR ON TABLE HOLD END TABLE 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.SALES END TABLE FILE CAR SUM SALES BY COUNTRY BY CAR BY TOTAL AVE.SALES END * Invented numbers No HOLD ! born Edward Israel Iskowitz BY AVE.SALES One Liners For FOCUS Efficiency

25 25 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 “If your ship doesn’t come in, swim out to it.” Jonathan Winters 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.

26 26 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 “????.” AVINGS: In-TABLE string manipulation 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 This slide is a continuation of the previous slide, supposed to look like we’re still on the same slide where it just clears everything but the right box initially. I also slowed the Wipe Transition to this slide to Medium for better effect. Marcel Marceau born Marcel Mangel One Liners For FOCUS Efficiency

27 27 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Replace Compound-IF in DEFINE with “WHERE” Jackie Vernon “When I was born my father spent three weeks trying to find a loophole in my birth certificate.” DEFINE FILE... TESTFIELD/A1 = IF (F1 EQ ‘ABC’) OR (F2 GE 27) THEN ‘Y’ ELSE ‘N’ ; END TABLE FILE... IF TESTFIELD EQ ‘Y' END DEFINE FILE... TESTFIELD/A1 = IF (F1 EQ ‘ABC’) OR (F2 GE 27) THEN ‘Y’ ELSE ‘N’ ; END TABLE FILE... IF TESTFIELD EQ ‘Y' END TABLE FILE... WHERE (F1 EQ ‘ABC’) OR (F2 GE 27) END TABLE FILE... WHERE (F1 EQ ‘ABC’) OR (F2 GE 27) END AVINGS: WHERE is much faster than compound-IF in DEFINE S Instead: Must use WHERE, not IF, in this compound situation One Liners For FOCUS Efficiency

28 28 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 = 99 TABLE FILE CAR PRINT … END TABLE FILE CAR … TABLE FILE EMPLOYEE … TABLE FILE CAR … TABLE FILE SALES … TABLE FILE EMPLOYEE … SET SAVEDMASTERS = 99 TABLE FILE CAR PRINT … END TABLE 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 …. S AVINGS: Large savings when a user constantly flips Masters. born Jacob Maza One Liners For FOCUS Efficiency

29 29 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion I could index SSN, but an index won’t help on partial searches Split a field into pieces for instantaneous searches Social Security Numbers Phone Numbers Credit Card Numbers Hottrack Numbers (we do!) “Fame comes with its own standards. A guy who twitches his lips is just another guy with a lip twitch – unless he’s Humphrey Bogart.” Sammy Davis Jr. AVINGS: Rock-bottom paging I/O when screening on that field. S SSN SSN4TO5 SSN1TO3 SSN6TO9 SSN DATA QUESTION How 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

30 30 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=GHI,,F4.1 FIELD=JKL,,D12.2 FIELD=MNO,,A5 FILE=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=GHI,,F4.1 FIELD=JKL,,D12.2 FIELD=MNO,,A5 FILE=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=LAST3,,A17 FILE=LOTSOF SEGMENT=ONE FIELD=ABC,,A10 FIELD=DEF,,I9 FIELD=LAST3,,A17 TABLE FILE SUM ABC BY DEF END TABLE FILE SUM ABC BY DEF END 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,,A Make sure you count the bytes properly One Liners For FOCUS Efficiency

31 31 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Display the number of the last page (Finally!) Notes: &FOCNEXTPAGE is set to TABLASTPAGE Supported for FORMAT HTML/PDF/PS only TABLE FILE CAR HEADING "PAGE

32 32 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion DEFINE/COMPUTE PHONE/A12 = ‘ ’; EXCH/A3 = EDIT (PHONE, ‘$$$$999’) ; EXCH/A3 = SUBSTR (12, PHONE, 5, 7, 3, EXCH) ; EXCH/A3 = GETTOK (PHONE, 12, 2, ’-’, 3, EXCH) ; DEFINE/COMPUTE PHONE/A12 = ‘ ’; EXCH/A3 = EDIT (PHONE, ‘$$$$999’) ; EXCH/A3 = SUBSTR (12, PHONE, 5, 7, 3, EXCH) ; EXCH/A3 = GETTOK (PHONE, 12, 2, ’-’, 3, EXCH) ; EDIT is faster than comparable subroutines “The guy who invented the first wheel was an idiot. The guy who invented the other three – he was a genius.” Sid Caesar AVINGS: 25-50% directly attributable to those calculations. S Extract the exchange EDIT does not apply to all situations of partial extractions born Isaac Sidney Caesar One Liners For FOCUS Efficiency

33 33 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Minimize test-run time during development -DEFAULT &1 = ‘ ‘ -SET &&IFRECORDLIMIT = IF &1 NE ‘TEST’ THEN ‘ ‘ - ELSE ‘IF RECORDLIMIT EQ 1’ ; TABLE FILE … PRINT … BY … &&IFRECORDLIMIT END EX focexecname TEST  Stop retrieval after the n th satisfying record  Generally for Developers to quick-test code  Easy to turn on and off; ignored in Production "I think I did pretty well, considering I started out with nothing but a bunch of blank paper”. Steve Martin Hint: Use global && Set once for entire application. Parameter &1 of call S AVINGS: Cut 99.9% of runtime (during testing). One Liners For FOCUS Efficiency &&IFRECORDLIMIT is NOT a reserved variable; could be any name.

34 34 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 “When I adlib something, I laugh for the same reason the audience does; I’ve never heard that joke before and I’m just as surprised as they are.” Steve Allen 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

35 35 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion - SET &CNT = 0 ; - LOOPTOP - SET &CNT = &CNT + 1 ; TABLE, MODIFY, etc. PRINT FIELD&CNT … - IF &CNT LE 10 GOTO LOOPTOP; - AFTERLOOP - SET &CNT = 0 ; - LOOPTOP - SET &CNT = &CNT + 1 ; TABLE, MODIFY, etc. PRINT FIELD&CNT … - IF &CNT LE 10 GOTO LOOPTOP; - AFTERLOOP - REPEAT LOOP FOR &CNT FROM 1 TO 10 TABLE, MODIFY, etc. PRINT FIELD&CNT … - LOOP - REPEAT LOOP FOR &CNT FROM 1 TO 10 TABLE, MODIFY, etc. PRINT FIELD&CNT … - LOOP Use –REPEAT instead of –IF loop Other options: -REPEAT label n TIMES -REPEAT label WHILE condition Randolph Duke: “Mother always said you were greedy.” Mortimer Duke: “She meant it as a complement.” Trading Places Ralph Don Bellamy Ameche AVINGS: Minor, yet far more readable code. S One Liners For FOCUS Efficiency Easier to code than “increment/check”. Can decrement. Can be negative. Hint: Use &’s to vary the range dynamically Dialog Manager dashes are Arial Black instead of TNR to make them stand out. Instead:

36 36 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion Capture FOCUS Commands and Statistics with FOCLOG “As a child my family’s menu consisted of two choices: take it or leave it.” Buddy Hackett AVINGS: Could be immense based on analysis of usage data. S 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. ind applications and focexecs that could significantly benefit from adjustment, consolidation, redesign. versee how much FOCUS is being used at your site. *FOCLOG is a chargeable product. See your local IBI Representative. born Leonard Hacker One Liners For FOCUS Efficiency

37 37 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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 I left the Thank You box to an On Click animation, intending that you will read this one to the audience in a storybook tone, press Enter, and roll into a “Thank You”. If you practice it, the effect is cool. If you don’t want to, then change the last animation to “After Previous’, or just be ready to press Enter. born Milton Berlinger One Liners For FOCUS Efficiency

38 38 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion

39 39 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion 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.  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.

40 40 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion One-Liners For [Web]FOCUS Efficiency WARNING This slide has a transition to the next slide after 11 seconds, specifically timed to play only the first of Rodney’s one-liners. The rest is not appropriate. Even if this slide is ‘inserted’ into another presentation, the timer goes with it (though not via cut-n-paste). Do not remove or change the slide transition timing! This slide requires speakers. The video clip on this slide (sitting behind the countdown box) must reside on the C: drive at that level, not in a sub-directory.

41 41 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion One-Liners For [Web]FOCUS Efficiency This slide requires speakers. The volume captured on this slide is much lower than the previous slide; adjust upward by hand during the presentation. No sound requirements after this slide. The video clip on this slide must reside on the C: drive at that level, not in a sub-directory.

42 42 *Opinions of comedians throughout this presentation are not necessarily those of the presenter nor Information Builders. Conclusion One-Liners For [Web]FOCUS Efficiency


Download ppt "1 ONE-LINERS for [Web]FOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. August, 2009 When Printing Handouts."

Similar presentations


Ads by Google