Edit macro @COMPARE Edit macro @COMPARE Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Macro name. @COMPARE users. PDF EDIT users particularly SCRIPT users type. Edit Macro resides in SYS1.TSOCLIST. The SPF/PC version in IS03. SPF2.MACROS may suffice for PC users but is not the same and does not use SuperC , which is not yet available in SPF/PC. -------------------------------------------------------------------------------- @COMPARE compares member in EDIT with corresponding member in specified DSN. -------------------------------------------------------------------------------- related PDF Option 3.12, SUPERC/SUPERCE on page PROC-1, PROD01C -------------------------------------------------------------------------------- Compares member in EDIT with the corresponding member in another library. %SUPERC (see page PROC-1) is invoked for the comparison. -------------------------------------------------------------------------------- Since square brackets are not available, optional material is enclosed in European brackets <...>. ISREDIT @COMPARE member|datasetname|DSN|CLIST|PROC|PROD01 -------------------------------------------------------------------------------- @COMPARE is used as a front-end to invoke %SUPERC (page PROC-1). Frequently you will be in edit on the member that you want to compare. The use of @COMPARE as a front-end to %SUPERC will simplify usage. Since @COMPARE is an edit macro, the dsname and membername you are in will be known to the macro and you will not need to supply this information when @COMPARE invokes %SUPERC. @COMPARE compares member in EDIT with a corresponding member in another speci- fied dataset, or with a specified member in the same dataset. The SEQ|NOSEQ process option will be selected for you based on the NUMBER ON|OFF in your current member's profile. Incorrect use of SEQ (SUPERC default is SEQ, where applicable) will result in a bad compare of an FB dataset with a VB dataset when both are not sequenced the comparison will be col 1-72 compared to col 9-251 of the VB dataset, which will compare lines as being different when they really are the same. specification of dataset must be first operand * Compares WORKSPACE to actual dataset currently in edit. Cannot be used to compare WORKSPACE to another da- taset. If data has been saved the compare will not take place and notification will be "SAVED/EQUAL" and "DATA NOT CHANGED, COMPARE WOULD BE EQUAL". datasetname Specifies a fully qualified dataset for comparison of same member as in edit. Supply all nodes. datasetname(member) Specifies a fully qualified dataset and member to be compared to the member in edit. partial.dsname.. The old dataset name will be comprised of the portion before the double periods and completed with the characters of the dataset currently in edit. This is not a node replacement but a count of charac- ters beginning with the first character. old current (new dataset) yields SYS6.. sys5.node2.node3 ---> SYS6.node2.node3 SYS6.. sys51.node2.node3 ---> SYS61.node2.node3 DSN You will be prompted to supply datasetname, use when command area is too cramped for space. CLIST Same as dsn of SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC PROC Same as dsn of SYS1.USERPROC PROD01 Same as dsn of TSOPROD.PROD01.CNTL **, or no options (1993/01/21 enhancement) * the current dataset will be the saved dataset, and the OLD dataset or member is located at the cursor. If cursor is not placed a long HELP message will result. If other options are included you must use **. CURSOR (1993/01/21 enhancement) * same as the * option except that OLD dataset will be the dsname or member lo- cated at the cursor. options supported by the @COMPARE edit macro EDIT Places you into edit on the generated comparison list userid.SUPERC.LIST. You may invoke the @PRINT macro to print the results. (Also see PRINT op- tion) PRINT Will invoke VPSPRINT to print the comparison list userid.SUPERC.LIST, upon exiting EDIT or BROWSE eliminating the need to use EDIT if BROWSE will do. R Reverses the NEWFILE and OLDFILE. Normally the NEWFILE will the dataset currently in edit, and the OLDFILE will be the dataset or member included on the @COMPARE invocation. The use of R (Reverse) will cause the normal order to be reversed. INX (1992/10/10 enhancement) * a LOC will be created for each line listed in the NEW file listing. User respon- sibility to use X ALL or whatever starting point they want. A macro will be created in the users LIBR.CLIST(ZCOMPX99), which may be edited before invoking it to make minor changes. The LOC will be based on col 123-127 (5 digits) found in the SUPERC listing. If these are not the numbers that will work for LOC in the NEW member than this technique will not function. The later use of the @PRINTNX macro may also be of interest afterwards. Example: (inclusion of % to indicate macro is op- tional) %@COMPARE * INX X ALL %ZCOMPX99 %LABNX %NXNX before(3) after(3) %@PRINTNX options passed on to %SUPERC by the @COMPARE macro Any parameters not recognized by @COMPARE are passed on to SUPERC, for more information on the %SUPERC clist refer to page PROC-1. Valid SUPERC options include the following: LIST(DELTA|LONG) DELTA - (default) changes only listed LONG - complete list includes matched lines CTYPE(LINE|WORD|BYTE) LINE - (default) compares LINEs WORD - compares WORDs BYTE - compares BYTEs, results in a hex listing, you probably don't want the BYTE comparison type. PROCESS(SEQ|NOSEQ) SEQ - (default of SUPERC) ignore sequence numbers NOSEQ - compare entire line, even if it con- tains sequence numbers Examples: @COMPARE SYS1.TSOCLIST(@COMPARE) @COMPARE SYS1.TSOCLIST @COMPARE * @COMPARE CLIST @COMPARE CLIST EDIT @COMPARE TSOPROD.PROD01.CNTL EDIT @COMPARE PROD01 EDIT PROD01C (similar) +------------------------------------------------------------------------------+ | | | If you are using the %SUPERC clist or the %@COMPARE macro and need to intro- | | duce process statements you may use option SYSIN(PROMPT). | | | | Example: | | @COMPARE CLIST SEQ /*data has sequence numbers ignore*/ | | | | @COMPARE CLIST SYSIN(PROMPT) NOSEQ /*treat sequence numbers as data*/ | | when prompted enter: | | CMPCOLM 1:72 /*hit enter and again at next prompt to | | indicate end of input*/ | +------------------------------------------------------------------------------+ @COMPARE macro to check changes to a production job If you have created a replacement member for a production job you may compare it to the production job using the following procedure: From within PDF edit of your replacement member If the member has the same name as in production. Enter ===> @COMPARE PROD01 If the dataset to be compared to is not TSOPROD.PROD01.CNTL Enter ===> @COMPARE 'datasetname(member)' Optional parameters EDIT You will be placed into EDIT on your userid.SUPERC.LIST dataset. Once in edit you may use the @PRINT macro to print your changes. LIST(CHNG) Lists up to 10 cards before/after your changes. The default is LIST(DELTA), which only lists the changes. After the comparison has been made using SUPERC and you have exited from the listing of changes, the @COMPARE macro will invoke the JCLCHECK macro described in the Data Center handout "Standards for Production Jobs and Pro- grams". Additional related items of interest * To check out several members after making changes via @DIR macro @DIR EDIT FROM(from) TO(to) * To get out of @DIR macro operation -- works only if you stop in edit @DIRPARM ABORT CANCEL * To compare member in edit with another member in same library @COMPARE (name) * To compare member in edit to same membername in another library @COMPARE other.fully.qualified.library * To compare member in edit to different membername in another library @COMPARE other.fully.qualified.library(member) * To compare member in edit to different membername in another library The current clist library is VB 255 8920, and the old library is FB 80 5600, so we want to compare only the first 72 columns. The SYSIN(PROMPT) will result in being prompted to enter cards. @COMPARE other.fully.qualified.library(member) at the prompt enter CMPCOLM 1:72 (hit enter to indicate no more input) * To compare a lot of members -- use PDF option 3.12 SUPERC, or use TSO Q SUPERC If you only want to see the differences make sure you choose the DELTA op- tion, suggest that you don't print as each member is actually on a separate page. If you use 'dsname(*)' as the current datasetname you will select all members. On the summary listing a double asterisk (**) indicates differ- ences. * To search an entire library (or selected members) for a character string use PDF option 3.14 SEARCHFOR, or use TSO Q SEARCH4 The second method should not be used if you expect a lot of hits back as you will be going into PDF edit, and running an initial macro. Internal Aspects: 1. A check is made to insure member in edit has been saved. 2. The first parameter must be another datasetname or substitution equivalent. The comparison datasetname is checked to make sure that it contains the member to be compared. 3. PROCESS parameter of PROCESS(SEQ) or PROCESS(NOSEQ) will be created based on content of current data -- NUMBER ON or NUMBER OFF. If you include your own PROCESS options the generated options will be ignored since SUPERC will ac- cept only the last PROCESS(xxx) parameter set received. 4. ANYC, accept in any case will be included with PROCESS() parameters. 5. Additional parameters are assimilated. Parameters not known to this macro will be passed on to SUPERC. 6. %SUPERC clist is invoked. 7. If the EDIT option is in effect the results will be placed into EDIT; other- wise you will be placed into BROWSE. 8. If the dataset compared to is TSOPROD.PROD01.CNTL then the %JCLCHECK macro will be invoked. Other considerations Comparison where either file is not a PDS is not currently available using the @COMPARE macro. Instead please use SUPERC (PDF option 3.11). SUPERC can be invoked ===> TSO Q SUPERC Use LISTING TYPE: DELTA PROCESS OPTIONS: SEQ|NOSEQ Specific questions How can I get a listing of all of the lines whether changed or not and print them 90 lines on a page on the 3900. To include all lines LIST(LONG) To extend page length to 90 lines is a bit trickier you must do the follow- ing: -- @COMPARE other.dataset LIST(LONG) SYSIN(PROMPT) EDIT -- then to the PROMPT enter LNCT 80 -- to actually print, once in edit ===> @PRINT CHAR(GT20) DOWN8 Operands must appear in this order for CHARS(GT20) to cause LINECT to de- fault to LINECT(90) in @COMPARE.