Home
Freedom/Pre-Compiler Fine Tuning CA 2E Generation User Guide
Contents
1. Delete Command Relational Op Compare String Compare Length Source Start Source End Replace String Relational Op Compare String Compare Length Source Start The Delete pre compiler command deletes the current source line based on the source line cursor Confidential Page 13 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 A source line positioning pre compiler command must be used before the use of the Delete pre compiler command in order to initialise the source line cursor An optional comparison can be performed to only delete the source line if it matches the comparison criteria specified If the comparison fails then return code is set to Y2U0022 and must be handled using an error handling pre compiler command Failure to monitor for the return code will cause the pre compiler group to exit abnormally with return code Y2U0022 If Relational Op is either EQ or NE then the current source line based on the source line cursor from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison If Compare Length is not specified then the length of the search argument is defaulted to the length of the Compare String excluding trailing blanks If Source Start is not s
2. If Compare Length is not specified then the length of the search argument is defaulted to the length of the Compare String excluding trailing blanks If Source Start is not specified then the scan starts at the beginning of the current source line or variable value If Source End is not specified then the scan completes at the end of the current source line or variable value The following figure is an example of the Elself pre compiler command that compares the current source line between column 50 and 63 with compare string PORTNbbbbbbbbb Command ElseIf Relational Op EQ TERE O Us anes ce 3 AF east aes J Compare String PORTN Compare Length l4 Source Start 50 Source End 63 Replace String The following figure is an example of the ElseIf pre compiler command that compares the current value of variable MySavedSourceLine between column 50 and 63 with compare string PORTNbbbbbbbbb Command ElseIf Relational Op EQ tinet Datta lt 2 3 Aro US Compare String PORTN Compare Length A Source Start 30 Source End 63 Replace String MySavedSourceLine ElseOnErr Command Relational Op Compare String Compare Length Source Start Source End Replace String ElseOnErr Relational Op The ElseOnErr pre compiler command ends a preceding OnErr or ElseOnErr group of pre compiler comm
3. Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Aik i f Z l e Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide Version 1 0 HawkBridge Pty Ltd 3 Highett Road Hampton VIC 3188 Australia http www HawkBridge com au Copyright 2011 by HawkBridge Pty Ltd All rights reserved including the right of reproduction in whole or in part in any form Confidential Page 1 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Table of Contents OVGIVICW asta ataca cphhethetsbbedtn T 3 Share WANG ie cscs nits aradan aaraa caventuanauenswacevdndvdnsencue davendusceceuduancdenduasdctadvauautadwaccuiadveneddadvedaus 3 Prerequisites cima aida 4 057 400 VSR2MO0 or DOVER 4 CAGE 80 SLOTS aia A ita a dd E it 4 Configuring the Freedom Pre Compiler TOOl oooooccccccconnncccnccccnonoconnnnnnanancccnnnnnnnnnnnananannes 5 Add FREEDOMPCP Library to Compilation Job Descriptions ccccesscesceesceesceeeeesecesecaeceeecaeecaeeeseeeeeeeeeeseeeneees 5 Setup the Global Pre Compile Exit Program 0 ccccccccesesssessseseceescesecesecaccsecsaecsuecseecaeecseseneeeaeeeeeseeeneseseeereserenerenaees 5 Setup the Global Post Compile Exit Programm ccccecsceessesscesseesceeecesecesecsecsaecssecaeecaeecaeeeseseaeseeeeeeaeseeeeeeeserenerenaees 5 Using the Freedom Pre Compiler TOO ccccccccsseeeeseee
4. Commands ccccesecscesseesseesseeseesseeseeeeceseceseensecaecnaecaecaaecaaesaecaaecaeecaeeeaeeseeenssenseenaeenaeenaes 12 Freedom Pre Compiler COMMAINGS ccccceseeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeeeeeseneseeeeeeeeeeees 13 NN 13 Back Wald A A eee a 13 Delete id A dessa ee ees a then regia abe ne evi Peers 13 Eli dia 1 14 El COME A bc ab 15 E ii a AA A Aa 16 End On Eu A it ea ee 16 A oes seccs ook s wo E EE eee Wat E sek see Redbg testes peo thease ba EE E R EE dE seh eens E E oE 16 Forward ssc eet AAA A aa eee 17 AA AAA A A AAA A ATA AE AAA 17 cl di A A AA A kaa ee 18 A NN 18 ES E O E O ee es 19 Online A A A a E EE 20 Di AAA AA AA A A AA A EE ACA ae 21 A A A E A e 21 A e a nt ea id cate eins 22 a O OSA 22 SUBS A a o ek RO ee 23 Update x auckch ata ei nneeok o AGAR ted Gutta 23 Command Reference nte aa 25 Work with Pre Compiler Groups HWRKPCPGRP cccccesseesseeeseesecesecseecseecseeeseeseeeeeesseeeseeeeeeeseenseeeseensenaeenaes 25 Confidential Page 2 21 May 2011 Copyright O 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Overview CA 2E is quite powerful as a design tool and building business applications yet there the limitations imposed by the generator that sometimes require the generated source to be modified prior to the object being compiled This could stem from a need to interface to non CA 2E applications with database files that do not
5. a matching source line starting with the next source line after the current source line cursor A comparison is performed with each source line in turn until it matches the comparison criteria specified If the comparison fails to find a source line before end of file then return code is set to Y2U0022 and must be handled using an error handling pre compiler command Failure to monitor for the return code will cause the pre compiler group to exit abnormally with return code Y2U0022 Relational Op must be specified as either EQ or NE and Compare String must also be specified Each source line from the next one based on the current source line cursor from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length The Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison Ifa Replace String is specified and the Relational Op is specified as EQ then that string will be inserted into the current source line in memory from the start position of the Compare String for the specified Compare Length prior to the source line being updated Ifa Replace String is specified and the Relational Op is specified as NE then that string will be inserted into the current source line in memory from the specified Source Start for the specified Compare Length prior to the source line being updated If Compare Length is not specified then the
6. code is set to Y2U0022 and must be handled using an error handling pre compiler command Failure to monitor for the return code will cause the pre compiler group to exit abnormally with return code Y2U0022 Confidential Page 23 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 If Relational Op is either EQ or NE then the current source line based on the source line cursor from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison The Pre Built Ind is specified as and indicates that the current source line value in memory is to be used for the current source line to be updated with The current source line value in memory may have been built by the InsString pre compiler command prior to processing the Update pre compiler command If the Pre Built Ind is specified then Compare String Compare Length Source Start Source End and Source String are not allowed If the Pre Built Ind is not specified then Source String must be specified If Compare Length is not specified then the length of the search argument is defaulted to the length of the Compare String excluding trailing blanks If Source Start is not specified then the scan starts at the beginning of the current
7. example of the Include pre compiler command to transfer control to the MYGROUP pre compiler group Command Include Relational Op Compare String MYGROUP Compare Length Source Start Source End Replace String Insert Command Relational Op Compare String Compare Length l Source Start Source End Replace String Pre Built Ind Source Length Source Start Source String Confidential Page 18 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 The Insert pre compiler command creates a new source file line after the source line identified by the current source line cursor Multiple Insert pre compiler commands performed in succession without changing the current source line cursor will create the source line after the last created source line The Pre Built Ind is specified as and indicates that the current source line value in memory is to be used for the new source line to be created The current source line value in memory may have been built by the InsString pre compiler command prior to processing the Insert pre compiler command If the Pre Built Ind is specified then Source String Source Length and Source Start are not allowed If the Pre Built Ind is not specified then Source String must be specified If Source String is specified then that string will be inserte
8. length of the search argument is defaulted to the length of the Compare String excluding trailing blanks If Source Start is not specified then the scan starts at the beginning of each source line If Source End is not specified then the scan completes at the end of each source line Confidential Page 22 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 The following figure is an example of the Scan pre compiler command that searches each source line between column 50 and 63 for an equal comparison with string PORTNbbbbbbbbb Command Relational Op Compare String Compare Length Source Start Source End Replace String The following figure is an example of the Scan pre compiler command that searches each source line between column 50 and 63for an equal comparison with string PORTNbbbbbbbbb If it is found then the source line is updated with string WORTNbbbbbbbbb Command Relational Op Compare String Compare Length Source Start Source End w Replace String SubString Command Relational Op Compare String Compare Length Source Start Source End Replace String SubString Variable Name Source Length The SubString pre compiler command updates the current variable value for the specified Variable Name Varia
9. only post compile exit program groups END OF DOCUMENT Confidential Page 26 21 May 2011 Copyright 2011 by HawkBridge Pty Lid
10. source line If Source End is not specified then the scan completes at the end of the current source line If Source String is specified then that string will be inserted into the current source line value in memory from the specified Source Start for Compare Length prior to the source line being updated The following figure is an example of the Update pre compiler command that updates the current source line from the current source line value in memory Relational Op Compare String Compare Length Source Start Source End Replace String The following figure is an example of the Update pre compiler command that updates the current source line with WORTNbbbbbbbbb if PORTNbbbbbbbbd is found between column 50 and 63 Command Relational Op Compare String Compare Length Source Start Source End Replace String Confidential Page 24 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Command Reference Work with Pre Compiler Groups HWRKPCPGRP Purpose The Work with Pre Compiler Groups HWRKPCPGRP command initiates a editor session for the Freedom Pre Compiler groups and associated commands Group name GRPNAM Specifies the name or partial name of the pre compiler group that the initial list is to display ANY I
11. the source member it will be replaced with the replacement string This will change the source line so that it becomes a comment line and not included in the compilation of the object From the Work with Pre Compiler Commands display that next appears press F3 twice to exit the Freedom Pre Compiler editor HWRKPCPCMD DISPLAY 16 05 11 17 46 36 Group UUABUFR RP GLE ANY ANY Work with Pre Compiler Commands PREDIR Remove PORTN entry parameter for RPGLE programs Len Str End Replace String 0 lt lt lt lt lt CALL HP 0 lt lt lt lt lt Cx Opt Seq Command Op Compare String 10 Scan EQ gt gt gt gt gt Y CALL HPRCPREDIR UUABUFR 32 0 20 Scan EQ Cc PARM PORTN 55 0 Bottom F3 Exit F9 Add F12 P revious Record added Opt 2 Edit 3 Copy 4 Delete 5 Display Re Generate and Compile the EXCEXTFUN function Make sure that FREEDOMPCP is in your model job description library list for generation and compilation There are no other Freedom Pre Compiler or CA 2E configuration options required in order to invoke the Pre Compiler Directive PREDIR command processor used in this example Submit the EXCEXTFUN function for re generation and compilation so that it now includes the call to the EXCUSRSRC function to invoke the Freedom Pre Compiler to remove the PORTN from the entry parameters Once the compilation of the EXCEXTFUN program has completed you can review the generated source and note the changes mad
12. AARA YBRTPXA 21 20 VALUE gt Confidential Page 5 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Using the Freedom Pre Compiler Tool To use the Freedom Pre Compiler tool to fine tune CA 2E generated source for an EXCEXTFUN function with source member name UUAAXER of type RP4 so that the PORTN entry parameter is removed follow these steps Create an EXCUSRSRC function to invoke the Source Member Pre Compile Directive For this example assume the EXCUSRSRC function has a source member name of UUABUFR of type RP4 Enter the following source lines for the EXCUSRSRC function Columns 1 100 Edit MY GEN QRPGLESRC SEU gt UUABUFR EM nat Bs Zas tt A ds a NO ss Y o Bats a D kk kkk kkk Beginning of dat a OCC dkk OSORIO OOOO OOOO OOOO OOOO OOOO OOOO 0001 00 This function removes the PORTN parameter from ENTRY parameters 110514 0002 00 gt gt gt gt gt Y CALL HPRCPREDIR UUABUFR amp C amp M amp F amp L 110514 kk kkk kkk OR AR RARA End of data RARO OOO FOI IO II IO III II III II III ISI IOI I IOI IO FOI I IOI I IO IO FOI IO IO AA F3 Exit F4 Prompt F5 Refresh F9 Retrieve F10 Cursor F11 Toggle F16 Repeat find F17 Repeat change F24 More keys Insert call to EXCUSRSRC function in the EXCEXTFUN function Edit the EXCEXTFUN function action diagram and enter the following statement to invoke the Freedom Pre Compiler during
13. Bridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 The following figure is an example of the RstSeq pre compiler command that updates the current source line cursor value in memory using the current variable value from MySavedSourceSequence Command Rst Seg Relational Op Bailo AD RL gee Rte oc BP E T TTE Compare String MySave Source Sequence Compare Length Source Start Source End Replace String SavSeq Command Relational Op Compare String Compare Length Source Start _ Source End _ Replace String SavSeq VaribleName The SavSeq pre compiler command updates the variable value with the current source line cursor in memory Variable Name must be specified and contain a valid integer value in the format 999999 including all leading zeros The following figure is an example of the SavSeq pre compiler command that updates current variable value of MySavedSourceSequence with the current source line cursor value in memory Command Relational Op Compare String Compare Length Source Start Source End Replace String Scan Command Relational Op Compare String Compare Length Source Start Source End Replace String Relational Op Compare String Compare Length Source Start Replace String The Scan pre compiler command searches for
14. ands and allows a series of pre compiler commands to be processed if an error condition is met The pre compiler commands controlled by the ElseOnErr pre compiler command are performed when the error comparison is true and the previous OnErr or ElseOnErr pre compiler command comparison was false An ElseOnErr pre compiler command must be preceded by an OnErr or ElseOnErr pre compiler command An ElseOnErr pre compiler command must be succeeded by an ElseOnErr or EndOnErr pre compiler command If a Return Code is not specified then the pre compiler commands controlled by the ElseOnErr pre compiler command are performed and then control passes to the next EndOnErr pre compiler command An optional error comparison can be performed to only perform pre compiler commands controlled by the ElseOnErr pre compiler command if it matches the error comparison criteria specified If the error comparison fails then control passes to the next ElseOnErr or EndOnErr pre compiler command If the error comparison is true then the pre compiler commands controlled by the ElseOnErr pre compiler command are performed and then control passes to the next EndOnErr pre compiler command Confidential Page 15 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 If Relational Op is either EQ or NE then the current value of the system return code will be compared to the Return Code specified A Re
15. ble Name must be specified and the current variable value will be updated with the current source line value in memory from the specified Source Start for Source Length If Source Length is not specified then the length is defaulted to the length of the current source line in memory from the Source Start excluding trailing blanks If Source Start is not specified then the Source Start is defaulted to the beginning of the current source line value The following figure is an example of the SubString pre compiler command that updates the current variable value for the MySavedSourceLine variable with the current source line value in memory between column and 7 Command SubString_ Relational Op Compare String Compare Length Source Start Source End Replace String Update Command Relational Op Compare String Compare Length Source Start Source End Replace String Update Relational Op or Compare String Compare Length Source Start Source End Source String Pre Built Ind The Update pre compiler command updates the current source line based on the source line cursor A source line positioning pre compiler command must be used before the use of the Update pre compiler command in order to initialise the source line cursor An optional comparison can be performed to only update the source line if it matches the comparison criteria specified If the comparison fails then return
16. by an Elself or EndIf pre compiler command If a Compare String is not specified then the pre compiler commands controlled by the ElseIf pre compiler command are performed and then control passes to the next EndIf pre compiler command An optional comparison can be performed to only perform pre compiler commands controlled by the Elself pre compiler command if it matches the comparison criteria specified If the comparison fails then control passes to the next ElseIf or EndIf pre compiler command If the comparison is true then the pre compiler commands controlled by the ElseIf pre compiler command are performed and then control passes to the next EndIf pre compiler command Confidential Page 14 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 If Relational Op is either EQ or NE then the current source line based on the source line cursor from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison If Variable Name is specified then the current variable value from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison
17. d into the current source line value in memory from the specified Source Start for Source Length prior to the new source line being created If Source Length is not specified then the length is defaulted to the length of the Source String excluding trailing blanks If Source Start is not specified then the Source String is inserted at the beginning of the current source line value The following figure is an example of the Insert pre compiler command that creates a new source line using the current source line value Command Relational Op Compare String Compare Length Source Start Source End Replace String The following figure is an example of the Insert pre compiler command that creates a new source line set to lt lt lt lt lt Test Insert Command Relational Op Compare String Compare Length Source Start Source End Replace String lt lt lt lt lt Test Insert InsString Command Relational Op Compare String Compare Length Source Start Source End Replace String InsString Variable Ind Variable Name Source Length Source Start Source String The InsString pre compiler command updates the current source line in memory The Variable Ind is specified as and indicates that the current variable value is to be used to update the current source line in memory If the Variable Ind is specif
18. e by Freedom Pre Compiler Confidential 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Page 10 Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Freedom Pre Compiler Command Summary The Freedom Pre Compiler Commands allow you to do many different types of operations on your source file as well as executing OS 400 commands This section summarizes the pre compiler commands that are available and also organises them into categories For detailed information about specific pre compiler commands see the next section Freedom Pre Compiler Commands The following table is a summary of the specifications for each pre compiler command e Anempty column indicates that the field must be blank e All underlined fields are required Command Relational Op Compare String Compare Length Source Start Source End Replace String Abort Return Code ay Backward Number of Lines o i Compare Length Source Start SourceEnd Compare Length Source Start ca ARCA Enae TE AECE EE EndOnErr NN Execute __ 08400 Command A Forward Number of Lines Compare Length Source Start Include Group Name ME ASS Insert Pre Built Ind Source Length Source Start OO Source String Source Length Source Start Source String nen ACP a as NE is SS ee Sequence Nbr___ SavSeq Variable Name a ee Compare Length Source Start SubString Variable Na
19. e compiler command is executed within a pre compiler group invoked from the Include pre compiler command then return code can be monitored by an OnErr ElseOnErr EndOnErr block in the pre compiler group that initiated the Include pre compiler command The following figure is an example of the Abort pre compiler command that exits with return code value of ERROR Command Relational Op Compare String Compare Length Source Start a Source End Replace String Backward Command Relational Op Compare String Compare Length Source Start Source End Replace String Backward Number of Lines The Backward pre compiler command moves the source line cursor a specified number of lines backwards from the current position Number of Lines must be specified as an integer in the range of to 999 The number of lines is based on the before image of the source member and does not include updates that may have already been processed by the pre compiler commands For instance using the Delete pre compiler command to remove a source line and then using the Backward pre compiler command will not move the source line cursor The following figure is an example of the Backward pre compiler command that moves the source line cursor backward 5 lines Command Relational Op Compare String Compare Length Source Start Source End Replace String
20. eedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 HWRKPCPGRP DISPLAY Work with Pre Compiler Groups 16 05 11 13 34 16 Opt Group Type Command File Execution Text 8 UUABUFR RPGLE ANY ANY PREDIR Remove PORTN entry parameter for RPGLE programs F3 Exit F9 Add F12 Previous Opt 2 Edit 3 Copy 4 Delete 8 Commands Record added From the Work with Pre Compiler Commands display that next appears press F9 to proceed to the Add Pre Compiler Command display HWRKPCPCMD DISPLAY Work with Pre Compiler Commands 16 05 11 17 17 35 Group UUABUFR RPGLE PREDIR Remove PORTN entry parameter for RPGLE programs F3 Exit F9 Add F12 Previous Opt 2 Edit 3 Copy 4 Delete 5 Display No data to display From the Add Pre Compiler Command display that next appears enter the following details then press Enter HEDTPCPCMD ADD Add Pre Compiler Command 16 05 11 17 25 03 Type choices press Enter Source Member UUABUFR Source Type 3 RPGLE Compile Command ANY Source File ANY Execution Type PREDIR Command Sequence 10 F3 Exit F12 Previous From the Edit Pre Compiler Command display that next appears enter the following details then press Enter and confirm Confidential Page 8 21 May 2011 Copyright O 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 HEDTPCPCMD ADD Edit Pre Compiler Com
21. eeeeeeeeeeeeeeeeeneeeeeeeeeeeeeeeeeseeneeeeneees 6 Create an EXCUSRSRC function to invoke the Source Member Pre Compile Directive cccceceseeseesteeseeteeees 6 Insert call to EXCUSRSRC function in the EXCEXTFUN function cecccceeseecseeeceeeceeeceeeenseceseceaecnseceeeasenteeaes 6 Create a Freedom Pre Compiler Group cin ii dictada dad 6 Define the Freedom Pre Compiler Commands for the new Pre Compiler Group ccceccceseeseceteeeeeceeeeeeeseenseeaes 7 Re Generate and Compile the EXCEXTFUN function ccooooonoonionnonnnonconnconcconoco nooo ncnnncnn nono ronn ron rro n narran rra n rra nnnnnran rra 10 Freedom Pre Compiler Command Summary cccccnnnnnnnnccnnonononennnnnananancnnnnnnnnnnnnnnanccnnnnnnnns 11 Branching Pre Compiler Commands isisi eteinen nnee non nn cnn non ron RR an RR nn RR O AEE eea EEEo EEE SSE T et 11 Compar Pre Compiler Comm e iaa de 11 Error Handling Pre Compiler Commands cccccessessseescesscesteeseceseesseceecesecsaecnaecaeecaeecaeeeneseeeeeeeeeresrenseeeeeesenseenaes 12 Source Line Positioning Pre Compiler Commands cceccesscessceseceseceseceeecseeeceeeseeeeeeeeeseenseeeaeeaeeaecaeecneeeeeeneeass 12 Source Line Update Pre Compiler Commands 0 ccccecscesscessceseceseceaecesecsaecaeeeaeeeaeceeeecesecnseceaeeaecaeensecneeeneeeaeeass 12 Structured Programming Pre Compiler Commands ccccescceseesseesceeseeeseeseceeceseenseceseeeeneeceseceaecsecnseeneeeeeeneeses 12 Variable Pre Compiler
22. equence Nbr The RstSeq pre compiler command updates the current source line cursor in memory This pre compiler command is used to position the current source line cursor in memory so that the next Insert Delete or Update will be performed on the matching source line the next Backward or Forward will start from the matching source line or the next Scan will be performed on the next matching source line The Variable Ind is specified as and indicates that the current variable value is to be used to update the current source line cursor in memory If the Variable Ind is specified then Sequence Nbr is not allowed If the Variable Ind is not specified then Variable Name is not allowed and Sequence Nbr must be specified and be an integer in the format 999999 including all leading zeros If Variable Name is specified then the current variable value will be used to update the current source line cursor value in memory If Sequence Nbr is specified then that string will be used to update the current source line cursor value in memory The following figure is an example of the RstSeq pre compiler command that updates the current source line cursor value in memory using the string 000025 Command Rst Seq Relational Op Compare String Compare Length Source Start Source End o o o Replace String 025 Confidential Page 21 21 May 2011 Copyright O 2011 by Hawk
23. er in the range of 1 to 999 The number of lines is based on the before image of the source member and does not include updates that may have already been processed by the pre compiler commands For instance using the Insert pre compiler command to add a source line and then using the Forward pre compiler command will not include the newly created source line in the count of lines to move The following figure is an example of the Forward pre compiler command that moves the source line cursor forward 5 lines Command Forward Relational Op Compare String Compare Length a Source Start 5 Source End a Replace String Command Relational Op Compare String Compare Length Source Start Source End Replace String Relational Op Compare String Compare Length Source Start Variable Name The If pre compiler command allows a series of pre compiler commands to be processed if a condition is met The pre compiler commands controlled by the If pre compiler command are performed when the comparison is true An If pre compiler command must be succeeded by an ElseIf or EndIf pre compiler command A comparison is performed to only perform pre compiler commands controlled by the If pre compiler command if it matches the comparison criteria specified If the comparison fails then control passes to the next ElseIf or EndIf pre compiler command If the comparison is true then the pre compiler com
24. fit the mould of pure CA 2E generated database files or implement a feature of IBM 15 not supported by CA 2E such as ALIAS names for SQL tables To make it easier to modify generated CA 2E source we have developed the Freedom Pre Compiler product to enable fine tuning of the generated object source prior to compilation with script based language for performing common tasks such as scanning updating inserting and deleting source lines Shareware This product is distributed as Shareware with a limited set of features enabled without the need to purchase a licence The limitations of the free version of the product are as follows Only the Source Member Pre Compile Directive can be used Y CALL HPRCPREDIR xxxxxxxxxx amp C amp M amp F amp L Only the first 9 commands per group accepted by processor Freeware comments imbedded into source member Implicit Quit command executed after 9th command Include and Execute commands will be ignored by processor Should you wish to use the extended set of features of the product you are required to purchase a license from HawkBridge Pty Ltd for your specific AS 400 The authorization will then enable you to install and use the product on a single AS 400 only The fully licensed version has no restrictions imposed apart from running on a single nominated AS 400 Shareware products are provided without warranty either implied or expressed It is your responsibility to ensure that the software is app
25. ied then Source String is not allowed If the Variable Ind is not specified then Variable Name is not allowed and Source String must be specified If Variable Name is specified then the current variable value will be inserted into the current source line value in memory from the specified Source Start for Source Length Confidential Page 19 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 If Source String is specified then that string will be inserted into the current source line value in memory from the specified Source Start for Source Length If Source Length is not specified then the length is defaulted to the length of the Source String excluding trailing blanks If Source Start is not specified then the Source String is inserted at the beginning of the current source line value The following figure is an example of the InsString pre compiler command that updates the current source line value in memory between column 1 and 7 using the string lt lt lt lt lt Command Relational Op Compare String Compare Length Source Start Source End Replace String The following figure is an example of the InsString pre compiler command that updates the current source line value in memory between column 1 and 7 using the current variable value from MySavedSourceLine Command InsSt
26. lational Op of EQ will perform an equality error comparison and NE will perform an inequality error comparison The following figure is an example of the ElseOnErr pre compiler command that compares the current value of the system return code with compare string Y2U0022 Command Relational Op Compare String Compare Length Source Start es Source End Replace String Endlf Command Relational Op Compare String Compare Length Source Start Source End Replace String Enait OP IES VEN E The EndIf pre compiler command ends a preceding If or ElseIf group of pre compiler commands An EndIf pre compiler command must be preceded by an If or ElseIf pre compiler command The following figure is an example of the EndIf pre compiler command Command EndIf Relational Op Compare String Compare Length Source Start Source End Replace String EndOnErr Command Relational Op Compare String Compare Length Source Start Source End Replace String EndOnErr The EndOnErr pre compiler command ends a preceding OnErr or ElseOnErr group of pre compiler commands An EndOnErr pre compiler command must be preceded by an OnErr or ElseOnErr pre compiler command The following figure is an example of the EndOnErr pre compiler command Command EndOnErr__ Relational Op Compare String Co
27. mand 16 05 11 17 28 11 Type changes press Enter Group Name UUABUFR Source Type RPGLE Compile Command ANY Source File ANY Execution Type PREDIR Command Sequence _10 Command Scan Relational Op EQ Pi ARA A eet as e gales Compare String gt gt gt gt gt Y CALL HPRCPREDIR UUABUER Compare Length 32 Source Start Source End Replace String lt lt lt lt lt CALL HPRCPREDIR UUABUFR F3 Exit F4 Prompt F12 Previous The above Pre Compiler Command will scan for the compare string which is the CA 2E pre compiler directive that invoked Freedom Pre Compiler to process this pre compiler group If the compare string is found in the source member it will be replaced with the replacement string This will change the CA 2E pre compiler directive so that it will not execute the next time the source member is used to compile the object without first regenerating the source member From the Work with Pre Compiler Commands display that next appears press F9 to proceed to the Add Pre Compiler Command display HWRKPCPCMD DISPLAY Work with Pre Compiler Commands 16 05 11 17 46 36 Group UUABUFR RPGLE ANY ANY PREDIR Remove PORTN entry parameter for RPGLE programs Opt Seq Command Op Compare String Len Str End Replace String 10 Scan EQ gt gt gt gt gt Y CALL HPRCPREDIR UUABUFR 32 0 0 lt lt lt lt lt CALL HP Bottom F3 Exit F9 Add F12 Previo
28. mands controlled by the If pre compiler command are performed and then control passes to the next EndIf pre compiler command Relational Op must be specified as either EQ or NE and Compare String must also be specified The current source line based on the source line cursor from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison If Variable Name is specified then the current variable value from the specified Source Start to Source End will be scanned and compared to the Compare String for the specified Compare Length A Relational Op of EQ will perform an equality comparison and NE will perform an inequality comparison If Compare Length is not specified then the length of the search argument is defaulted to the length of the Compare String excluding trailing blanks Confidential Page 17 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 If Source Start is not specified then the scan starts at the beginning of the current source line or variable value If Source End is not specified then the scan completes at the end of the current source line or variable value The following figure is an example of the If pre compiler command that compares the current source line between column 50 a
29. me Source Length Source Start CA eee Pre Built Ind Branching Pre Compiler Commands The branching pre compiler commands are shown in the following table Command Description Stops processing the pre compiler commands and exits abnormally with a specific return code or default return code of Y2U9999 Transfers control to the OS400 Command specified Transfers control to the pre compiler group specified Quit Stops processing the pre compiler commands and exist normally Compare Pre Compiler Commands The compare pre compiler commands are shown in the following table Command Description Deletes the current source line based on the source line cursor Elself Ends a preceding If or ElseIf group of pre compiler commands and allows a series of pre compiler commands to be processed if a condition is met ElseOnErr Ends a preceding OnErr or ElseOnErr group of pre compiler commands and allows a series of pre compiler commands to be processed if an error condition is met Confidential Page 11 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Error Handling Pre Compiler Commands The error handling pre compiler commands are shown in the following table Command Description Abort Stops processing the pre compiler commands and exits abnormally with a specific return code or default return code of Y2U9999 ElseOnErr Ends a preceding OnEr
30. mpare Length Source Start Source End Replace String Execute Command Relational Op Compare String Compare Length Source Start Source End Replace String Execute 0OS400Command AAA The Execute pre compiler command transfers control to the OS400 Command specified NOTE This pre compiler command is not available in the Shareware version of the product The OS400 Command must be specified and must define a valid OS400 command that can be executed Up to 100 characters can be specified for the OS Command which is executed without increasing the OS400 command invocation level Confidential Page 16 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 The following figure is an example of the Execute pre compiler command to perform an override to a file Command Execute Relational Op at ro e E guest gee CA bs tes Compare String OVRDBF FROMFILE TOFILE Compare Length Source Start Source End Replace String Forward Command Relational Op Compare String Compare Length Source Start Source End Replace String Forward S Nimboo lines The Forward pre compiler command moves the source line cursor a specified number of lines forwards from the current position Number of Lines must be specified as an integ
31. nd 63 with compare string PORTNbbbbbbbbb Relational Op Compare String Compare Length Source Start Source End Replace String The following figure is an example of the If pre compiler command that compares the current value of variable MySavedSourceLine between column 50 and 63 with compare string PORTNbbbbbbbbb Relational Op Compare String Compare Length Source Start Source End Replace String lySavedSourceLine Include Command Relational Op Compare String Compare Length Source Start Source End Replace String Finclude GroupName EA The Include pre compiler command transfers control to the pre compiler group specified by Group Name NOTE This pre compiler command is not available in the Shareware version of the product Pre compiler groups are identified by the following attributes Group Name Source Type Compile Command Source File and Execution Type The pre compiler group specified by Group Name must exist for one of the matching lookup patterns e Current Source Type current Compile Command current Source File and current Execution Type e Current Source Type Compile Command of ANY current Source File and current Execution Type e Current Source Type Compile Command of ANY Source File of ANY and current Execution Type The following figure is an
32. ndicates that the initial list of pre compiler groups will include all compiler groups Source type SRCTYP Specifies the name of the source file types that the initial list is to display ANY Indicates that the initial list of pre compiler groups will include all source types Compile command CPLCMD Specifies the name of the compile command that the initial list is to display ANY Indicates that the initial list of pre compiler groups will include all compiler commands Source file SRCFIL Specifies the name of the source file that the initial list is to display ANY Indicates that the initial list of pre compiler groups will include all source files Confidential Page 25 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Execution type EXCTYP Specifies the name of the execution type that the initial list is to display ANY Indicates that the initial list of pre compiler groups will include all execution types PREPGM Indicates that the initial list of pre compiler groups will include only pre compile exit program groups PREDIR Indicates that the initial list of pre compiler groups will include only pre compile directive groups POSTDIR Indicates that the initial list of pre compiler groups will include only post compile directive groups POSTPGM Indicates that the initial list of pre compiler groups will include
33. pecified then the scan starts at the beginning of the current source line If Source End is not specified then the scan completes at the end of the current source line The following figure is an example of the Delete pre compiler command that deletes the current source line Command Delete Relational Op Compare String Compare Length Source Start s Source End Replace String The following figure is an example of the Delete pre compiler command that deletes the current source line if PORTNbbbbbbbbb is found between column 50 and 63 Command Relational Op Compare String Compare Length Source Start Source End Replace String Elself Command Relational Op Compare String Compare Length Source Start Source End Replace String Elself Relational Op Compare String Compare Length Source Start Variable Name The ElseIf pre compiler command ends a preceding If or ElseIf group of pre compiler commands and allows a series of pre compiler commands to be processed if a condition is met The pre compiler commands controlled by the ElseIf pre compiler command are performed when the comparison is true and the previous If or ElseIf pre compiler command comparison was false An Elself pre compiler command must be preceded by an If or ElseIf pre compiler command An Elself pre compiler command must be succeeded
34. pilation Ensure you check your model profile for the correct job description to update as it is possible for two job descriptions to be used in your model One is for generation and the other is for compilation The Freedom Pre Compiler tool only needs you to change the compilation job description Setup the Global Pre Compile Exit Program The global pre compile exit program is defined in the CA 2E shipped dataarea YBRTPXA located in library Y1SY or the library that you installed the CA 2E Toolkit Product Library To enable the Freedom Pre Compiler to be invoked as the global pre compile exit program you need to execute the following command e CHGDTAARA DTAARA YBRTPXA 1 20 VALUE HPRCPREPGM To disable the Freedom Pre Compiler from being invoked as the global pre compile exit program you need to execute the following command e CHGDTAARA DTAARA YBRTPXA 1 20 VALUE Setup the Global Post Compile Exit Program The global post compile exit program is defined in the CA 2E shipped dataarea YBRTPXA located in library Y1SY or the library that you installed the CA 2E Toolkit Product Library To enable the Freedom Pre Compiler to be invoked as the global post compile exit program you need to execute the following command e CHGDTAARA DTAARA YBRTPXA 21 20 VALUE HPRCPSTPGM To disable the Freedom Pre Compiler from being invoked as the global post compile exit program you need to execute the following command e CHGDTAARA DT
35. piler commands are shown in the following table Command Description Elself Ends a preceding If or ElseIf group of pre compiler commands and allows a series of pre compiler commands to be processed if a condition is met EndIf Ends a preceding If or ElseIf group of pre compiler commands Allows a series of pre compiler commands to be processed if a condition is met Variable Pre Compiler Commands The variable pre compiler commands are shown in the following table Command Description ElseIf Ends a preceding If or ElseIf group of pre compiler commands and allows a series of pre compiler commands to be processed if a condition is met Allows a series of pre compiler commands to be processed if a condition is met Confidential Page 12 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Freedom Pre Compiler Commands This section describes in alphabetical order each Freedom Pre Compiler Command in detail with examples Abort Command Relational Op Compare String Compare Length Source Start Source End Replace String Abort Return Code ___ AS The Abort pre compiler command stops processing the pre compiler commands in the current pre compiler group and exits abnormally If Return Code is not specified then a default return code of Y2U9999 is used to signal an abnormal termination of the pre compiler group If the Abort pr
36. r or ElseOnErr group of pre compiler commands and allows a series of pre compiler commands to be processed if an error condition is met EndOnErr Ends a preceding OnErr or ElseOnErr group of pre compiler commands Allows a series of pre compiler commands to be processed if an error condition is met The error handling pre compiler commands are only performed when there is an error condition resulting from the previous pre compiler command failing An error condition is determined when non blank return codes are returned from pre compiler commands Once the error condition on an OnErr or ElseOnErr pre compiler command is true the error condition is reset to normal and the value of the system return code is set to blanks Source Line Positioning Pre Compiler Commands The source line positioning pre compiler commands are shown in the following table Command Description Moves the source line cursor a specified number of lines backwards from the current position Moves the source line cursor a specified number of lines forwards from the current position Updates the current source line cursor in memory Searches for a matching source line starting with the next source line after the current source line cursor Source Line Update Pre Compiler Commands The source line update pre compiler commands are shown in the following table Command Description Structured Programming Pre Compiler Commands The structured programming pre com
37. ring Relational Op ied PEE E E E A ee cade es 8 Compare String MySavedSourceLine Compare Length Source Start LL Source End Replace String OnErr Command Relational Op Compare String Compare Length Source Start Source End Replace String Relational Op RetunCode _ ay The OnErr pre compiler command allows a series of pre compiler commands to be processed if an error condition is met The pre compiler commands controlled by the OnErr pre compiler command are performed when the error comparison is true An OnErr pre compiler command must be succeeded by an ElseOnErr or EndOnErr pre compiler command If a Return Code is not specified then the pre compiler commands controlled by the OnErr pre compiler command are performed and then control passes to the next EndOnErr pre compiler command An optional error comparison can be performed to only perform pre compiler commands controlled by the OnErr pre compiler command if it matches the error comparison criteria specified If the error comparison fails then control passes to the next ElseOnErr or EndOnErr pre compiler command If the error comparison is true then the pre compiler commands controlled by the OnErr pre compiler command are performed and then control passes to the next EndOnErr pre compiler command If Relational Op is either EQ or NE then the current value of the system return code will be compared to the Ret
38. ropriate for your installation Confidential Page 3 21 May 2011 Copyright O 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Prerequisites The following prerequisites must be satisfied in order to use the tool e OS 400 V5R2M0 or above installed e CA2E800 8 1 or 8 5 Data Model OS 400 V5R2M0 or above The AS 400 objects in this release have been saved for VSR2MO If you are on an earlier release then contact us for a version that supports your version of OS 400 Objects have been saved in a format that will enable Freedom Pre Compiler to be restored to V6R1 and V7R1 of OS 400 CA 2E 8 0 8 1 or 8 5 The tool has been developed for Release 8 0 8 1 and 8 5 of CA 2E If you are on a later release then contact us for the upgraded version of the tool Prior releases may work but may not due to internal file changes to the CA 2E data model Confidential Page 4 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Configuring the Freedom Pre Compiler Tool This section describes how to configure your environment so that the Freedom Pre Compiler will be invoked Add FREEDOMPCP Library to Compilation Job Descriptions NOTE This configuration option is the only one required for the Shareware version of the product Make sure that FREEDOMPCP is in your model job description library list for com
39. the compilation of the EXCEXTFUN program EDIT ACTION DIAGRAM Edit MYMDL My File FIND gt My EXCEXTFUN I C 1 S F Insert construct I X 0 F Insert alternate case I A E Q A F Insert action IMF Insert message gt My EXCEXTFUN ben e lt lt lt zRmv Parameter PORTN My Pre Compiler Overrides UUABUFR lt lt lt F3 Prev block F5 User points F6 Cancel pending moves F23 More options F7 Find F8 Bookmark F9 Parameters F24 More keys The above action diagram statement can be included anywhere in the EXCEXTFUN function or lower level internal functions that are called by the EXCEXTFUN function Create a Freedom Pre Compiler Group Make sure that FREEDOMPCP is in your library list The minimum library list to run the tool is e QTEMP FREEDOMPCP Prompt the command HWRKPCPGRP to start the Freedom Pre Compiler editor as follows then press Enter Confidential Page 6 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Work with Pre Compiler Groups HWRKPCPGRP Type choices press Enter Group DAME a es ae es ANY Character value ANY Source type A y u e we ANY ANY BAS BASP BND C Compiler command ANY Name ANY Source Tile Aei rd me a ANY Name ANY Execution type ANY ANY PREPGM PREDIR Bottom F3 Exit F4 Prompt F5 Refresh F12 Cancel F13 How to use this display F24 More ke
40. urn Code specified A Relational Op of EQ will perform an equality error comparison and NE will perform an inequality error comparison The following figure is an example of the OnErr pre compiler command that compares the current value of the system return code with compare string Y2U0022 Confidential Page 20 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 Command OnE rr Relational Op EQ Compare String 2U0022 Compare Length Source Start Source End Replace String Quit Command Relational Op Compare String Compare Length Source Start Source End Replace String The Quit pre compiler command stops processing the pre compiler commands in the current pre compiler group and exits normally If the Quit pre compiler command is executed within a pre compiler group invoked from the Include pre compiler command then control returns to the pre compiler group that initiated the Include pre compiler command The following figure is an example of the Quit pre compiler command Command Relational Op Compare String Compare Length Source Start Source End Replace String RstSeq Command Relational Op Compare String Compare Length Source Start Source End Replace String Variable Ind Variable Name S
41. us Opt 2 Edit 3 Copy 4 Delete 5 Display Record added From the Add Pre Compiler Command display that next appears enter the following details then press Enter HEDTPCPCMD ADD Add Pre Compiler Command 16 05 11 17 25 03 Type choices press Enter Group Name UUABUFR Source Type RPGLE Compile Command ANY Source File ANY Execution Type PREDIR Command Sequence 020 F3 Exit F12 Previous From the Edit Pre Compiler Command display that next appears enter the following details then press Enter and confirm Confidential Page 9 21 May 2011 Copyright 2011 by HawkBridge Pty Ltd Freedom Pre Compiler Fine Tuning CA 2E Generation User Guide 1 0 HEDTPCPCMD ADD Edit Pre Compiler Command 16 05 11 17 28 11 Type changes press Enter Group Name UUABUFR Source Type RPGLE Compile Command ANY Source File ANY Execution Type PREDIR Command Sequence _20 Command Scan Relational Op EQ See E E cette 2 repaint 3s tase 4 aches S Compare String e PARM P TEN Compare Length 99 Source Start 3 Source End CPES Replace String lt lt lt lt lt C PARM P ORTN F3 Exit F4 Prompt F12 Previous The above Pre Compiler Command will scan for the compare string which is the parameter calculation specification for the implicit return code field PORTN If the compare string is found in
42. ys From the Work with Pre Compiler Groups display that next appears press F9 to proceed to the Add Pre Compiler Group display HWRKPCPGRP DISPLAY Work with Pre Compiler Groups 16 05 11 13 34 16 Opt Group Type Command File Execution Text F3 Exit F9 Add F12 Previous Opt 2 Edit 3 Copy 4 Delete 8 Commands No data to display From the Add Pre Compiler Group display that next appears enter the following details then press Enter When defining a Pre Compiler Group the source member name of the EXCUSRSRC is the recommended name to use for the group This enables you to easily identify the relationship between the pre compiler group and EXCUSRSRC function You could choose to use any other name for the pre compiler group HADDPCPCMD ENTER Add Pre Compiler Group 16 05 11 14 08 28 Type choices press Enter Group Name UUABUFR___ Source Type RPGLE Compile Command ANY Optional Source File ANY Optional Execution Type PREDIR__ Group Text Remove PORTN entry parameter for RPGLE programs _ F3 Exit F4 Prompt F12 Previous Define the Freedom Pre Compiler Commands for the new Pre Compiler Group From the Work with Pre Compiler Groups display that next appears type option 8 against the newly created Pre Compiler Group to proceed to the Work with Pre Compiler Commands display Confidential Page 7 21 May 2011 Copyright O 2011 by HawkBridge Pty Ltd Fr
Download Pdf Manuals
Related Search
Related Contents
Manuel d`interrogation Man HR140 Modelle 8530, 8531 und 8532 DUSTTRAK™ II-Aerosolmonitor ADT Security Services BHS-4000A User's Manual 充放電システム Cell Charger 取扱説明書 REDMOND RS-713 personal scale ServerView Integration Pack 2.3 for Tivoli NetView 7.1 Nokia 7230 2.4" 100g Grey DE-U501ZP1/ZP2 Copyright © All rights reserved.
Failed to retrieve file