Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2007, Information Builders. Slide 1 ONE-LINERS for WebFOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders,

Similar presentations


Presentation on theme: "Copyright 2007, Information Builders. Slide 1 ONE-LINERS for WebFOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders,"— Presentation transcript:

1 Copyright 2007, Information Builders. Slide 1 ONE-LINERS for WebFOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders, Inc. June 2012 When Printing Handouts USE “Pure Black and White” not “Grayscale” Otherwise, all of the reverse-color text will not show up. 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. Skip video 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 JUMP Copyright 2007, Information Builders. Slide 2 One-Liners For WebFOCUS 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. 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. 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 JUMP Prove it - How do I see these savings? -SET &STARTCPU = &FOCCPU ; TABLE …. -RUN -SET &ENDCPU = &FOCCPU ; -SET &USED=(&ENDCPU - &STARTCPU) /1000; -TYPE Table used &USED CPU seconds -SET &STARTCPU = &FOCCPU ; TABLE …. -RUN -SET &ENDCPU = &FOCCPU ; -SET &USED=(&ENDCPU - &STARTCPU) /1000; -TYPE Table used &USED CPU seconds Capture CPU in-stream Examine post-execution operating system statistics

4 JUMP Copyright 2007, Information Builders. Slide 4 Data already sorted in the order of the report request? Use TABLEF !! “I installed a skylight in my apartment yesterday. The people who live above me are really furious.” 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 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. One Liners For FOCUS Efficiency

5 JUMP Copyright 2007, Information Builders. Slide 5 Performs the sort phase, but does not build internal matrix. Sort and merge data Ellen Degeneres “My grandmother started walking five miles a day when she was sixty. She’s ninety-seven now, and we have no idea where she is.” Use AUTOTABLEF to bypass the Merge phase AVINGS: This customer cut a 6-hour report to 6-minutes. S One Liners For FOCUS Efficiency WHITE BOX EXPLANATION TABLE FILE … SUM [~200 fields] BY [3 sorts] ON TABLE HOLD END TABLE FILE … SUM [~200 fields] BY [3 sorts] ON TABLE HOLD END Extract data Generate report SET AUTOTABLEF=ON

6 JUMP Copyright 2007, Information Builders. Slide 6 "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 ON TABLE HOLD END SET SAVEMATRIX = OFF TABLE FILE CAR SUM DCOST BY COUNTRY ON TABLE HOLD END No need to create or preserve the Internal Matrix? When is SAVEMATRIX=ON needed ? See next slide. Savematrix defaults to OFF in Rel 7.2+, but might be set ON in a site-wide profile. AVINGS: Significant cost of creating a matrix that is not used. S born Nathan Birnbaum One Liners For FOCUS Efficiency

7 JUMP Copyright 2007, Information Builders. Slide 7 “I’m not going to buy my kids an encyclopedia. Let them walk to school like I did.” Yogi Berra Do the HOLDs 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 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 saved matrix Re-extracts entire data set 3 times Re-extracts entire set of data 3 times ! born Lawrence Peter Berra One Liners For FOCUS Efficiency Instead:

8 JUMP Copyright 2007, Information Builders. Slide 8 Extract once to HOLD, then do multiple TABLEs 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 S AVINGS: Spend a little, get a lot, when high degree of aggregation. “Apparently, a new survey says that three out of four people make up 75% of the population.” David Letterman One Liners For FOCUS Efficiency Why extract the entire database four times?

9 JUMP Copyright 2007, Information Builders. Slide 9 “I was going to have cosmetic surgery until I noticed that the doctor's office was full of portraits by Picasso.” Rita Rudner For constants, use an &Variable instead of DEFINE DEFINE FILE CAR INCR/I3 = 50 ; END TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + INCR ; BY COUNTRY BY CAR END DEFINE FILE CAR INCR/I3 = 50 ; END TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + INCR ; BY COUNTRY BY CAR END - SET &INCR = 50 ; TABLE FILE CAR SUM DCOST COMPUTE NEWCOST=DCOST + &INCR ; BY COUNTRY BY CAR END - SET &INCR = 50 ; 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:

10 JUMP “The IQ and the life expectancy of the average American recently passed each other, going in opposite directions.” 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 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 TABLE FILE CAR SUM DCOST COMPUTE INCR/I7 = DCOST * 5 ; BY COUNTRY BY CAR END Calculated 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: Calculated for each report row after summation

11 JUMP Copyright 2007, Information Builders. Slide 11 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 "I always wanted to be somebody, but I should have been more specific." Lily Tomlin One Liners For FOCUS Efficiency The flat file is sorted on the screened field; stop searching when you see a larger value. “ “

12 JUMP Copyright 2007, Information Builders. Slide 12 Reformat fields inside the 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 Hint: Extra field appears in a HOLD file. To remove, SET HOLDLIST=PRINTONLY AVINGS: Only final displayed field is reformatted. S Instead: “I base most of my fashion taste on what doesn't itch.” Gilda Radner One Liners For FOCUS Efficiency

13 JUMP Copyright 2007, Information Builders. Slide 13 COUNTRY CAR MODEL BODY DCOST 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 “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 One Liners For FOCUS Efficiency

14 JUMP Copyright 2007, Information Builders. Slide 14 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 Note: Index view requires test on indexed field

15 JUMP Copyright 2007, Information Builders. Slide 15 “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 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.” - WebFOCUS S AVINGS: Could be 100’s of times faster on large volumes. Call system sort DEFGHDEFGH Sorted One Liners For FOCUS Efficiency Same applies to MAINTAIN Same applies to MAINTAIN

16 JUMP Copyright 2007, Information Builders. Slide 16 “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, … … Carly CorinthosOperator Alexis DavisTechnical Dr. Patrick DrakeOperator Damian SpinelliTechnical Dante FalconeriVice Pres Ethan LovettOperator Johnny ZaccharaManager Olivia FalconeriSecretary Shawn ButlerTechnical Steven WebberManager Jasper "Jax" JacksPresident Luke SpencerPresident Maxie JonesOperator Sonny CorinthosPresident Elizabeth SpenserSecretary Samantha McCallOperator Jason MorganTechnical Edward QuartermaineVice Pres Michael Corinthos, IIIOperator Tracy QuartermaineOperator Malcolm ‘Mac’ ScorpioManager Lulu SpencerOperators Max GiambettiTechnical Elizabeth WebberTechnical 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

17 JUMP Copyright 2007, Information Builders. Slide 17 >> 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 Build your own External Index when you don’t have write access to the file TABLE FILE filename. indexfield Build your own index Note: External Index is static - not updated per transaction. Must Rebuild Index if file changes, say nightly. “A boy can learn a lot from a dog: obedience, loyalty, and the importance of turning around three times before lying down.” Robert Benchley One Liners For FOCUS Efficiency Non-writeable file, no index on field 2

18 JUMP Copyright 2007, Information Builders. Slide 18 BY TOTAL – Sort by computed columns in one pass AVINGS: Eliminates second pass of the data – could be 50%. S 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 ! BY AVE.SALES “Curious people are interesting people. I wonder why that is.“ Bill Maher One Liners For FOCUS Efficiency

19 JUMP Copyright 2007, Information Builders. Slide 19 Display the number of the last page (Finally!) TABLE FILE CAR HEADING "PAGE

20 JUMP Copyright 2007, Information Builders. Slide 20 DEFINE FILE... EXCHANGE/A3 = EDIT(PHONE,'$$$999$$$$'); FLAG/A1 = IF (SALARY + BENEFITS GT 50000) AND (EXCHANGE EQ '736‘) THEN 'Y' ELSE 'N'; END 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 AVINGS: Potentially significant reduction in calculation time. S 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. “The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...‘ ” Isaac Asimov One Liners For FOCUS Efficiency

21 JUMP Copyright 2007, Information Builders. Slide 21 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

22 JUMP Copyright 2007, Information Builders. Slide 22 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 Extracts might be more efficient 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 JUMP Copyright 2007, Information Builders. Slide 23 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 parsing time, especially for 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,,A Make sure you count the bytes properly One Liners For FOCUS Efficiency

24 JUMP Copyright 2007, Information Builders. Slide 24 JOIN files on any fields without indexes based on any calculation 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

25 JUMP Copyright 2007, Information Builders. Slide 25 Use JOIN instead of WHERE IN FILE TABLE FILE CAR PRINT COUNTRY WHERE COUNTRY NE 'ENGLAND' ON TABLE HOLD AS VALUES FORMAT ALPHA END TABLE FILE CAR PRINT COUNTRY WHERE COUNTRY NE 'ENGLAND' ON TABLE HOLD AS VALUES FORMAT ALPHA END AVINGS: JOIN is generally faster than a file search for each record S TABLE FILE CAR SUM SEATS BY COUNTRY WHERE COUNTRY IN FILE VALUES END TABLE FILE CAR SUM SEATS BY COUNTRY WHERE COUNTRY IN FILE VALUES END JOIN COUNTRY IN VALUES TO COUNTRY IN CAR AS J1 TABLE FILE VALUES SUM SEATS BY COUNTRY END JOIN COUNTRY IN VALUES TO COUNTRY IN CAR AS J1 TABLE FILE VALUES SUM SEATS BY COUNTRY END “If dogs could talk, it would take a lot of the fun out of owning one.” Andy Rooney One Liners For FOCUS Efficiency

26 JUMP Copyright 2007, Information Builders. Slide 26 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 CAR PRINT... WHERE VALUE3 LT '736‘ WHERE VALUE4 EQ ‘ABC‘ WHERE VALUE2 EQ 'Y‘ END TABLE FILE CAR PRINT... WHERE VALUE3 LT '736‘ WHERE VALUE4 EQ ‘ABC‘ WHERE VALUE2 EQ 'Y‘ END Automatically uses the first index, regardless of how the WHEREs are arranged in the TABLE Force WebFOCUS to use the most valuable Index. Only you know which one that is!.VALUE3 CAR Master

27 JUMP Copyright 2007, Information Builders. Slide 27 “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 FOCUS databases 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 savings. S One Liners For FOCUS Efficiency * (up to 7 indexes)

28 JUMP Copyright 2007, Information Builders. Slide 28 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 Hint: Use global && Set once for entire application. Parameter &1 of call S AVINGS: Cut 99.9% of runtime (during testing). &&IFRECORDLIMIT is NOT a reserved variable; could be any name. “Apparently, a new survey says that three out of four people make up 75% of the population.” David Letterman “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 born Phyllis Ada Driver One Liners For FOCUS Efficiency

29 JUMP Copyright 2007, Information Builders. Slide 29 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

30 JUMP Copyright 2007, Information Builders. Slide 30 - 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 Hint: Use &’s to vary the range dynamically Hint: Use &’s to vary the range dynamically. Can decrement. Can be negative. Dialog Manager dashes are Arial Black instead of TNR to make them stand out. Instead:

31 JUMP Copyright 2007, Information Builders. Slide 31 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 – 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

32 JUMP Copyright 2007, Information Builders. Slide 32 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 WebFOCUS 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 verbal 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

33 JUMP End of presentation. Press Esc now. Copyright 2007, Information Builders. Slide 33

34 JUMP Copyright 2007, Information Builders. Slide 34 Director, Focus Div, Information Builders “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

35 JUMP Copyright 2007, Information Builders. Slide 35 “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)

36 JUMP Copyright 2007, Information Builders. Slide 36 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 JUMP Copyright 2007, Information Builders. Slide 37 I could index SSN, but an index won’t help on partial searches Split a field into pieces for instantaneous searches USE FOR Social Security Numbers Phone Numbers Credit Card Numbers Hottrack Numbers (we do!) AVINGS: Rock-bottom I/O when searching for 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 “Always get married in the morning. That way if it doesn’t work out, you haven’t wasted the whole day.” Mickey Rooney born Joseph Yule, Jr. One Liners For FOCUS Efficiency

38 JUMP Copyright 2007, Information Builders. Slide 38 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


Download ppt "Copyright 2007, Information Builders. Slide 1 ONE-LINERS for WebFOCUS Efficiency Joel Starkman Director of Operations, FOCUS Division Information Builders,"

Similar presentations


Ads by Google