/*REXX****************************************************************/ /*-------------------------------------------------------------------*/ /* */ /* Licensed Materials - Property of IBM */ /* */ /* 5697-SD9 */ /* */ /* (C) Copyright IBM Corp. 2001 */ /* */ /*-------------------------------------------------------------------*/ /* TSX to see if a Data View Record has 2 Data Attribute Records */ /* that are for the same s-word. */ /* */ /* Run TSX BLGTXDUP from the Information Management command line */ /* while on the display summary panel of the data view record */ /* to be checked. */ /* */ /* Input: None */ /* */ /* Output: Messages to the screen with the duplicate data attribute */ /* record RNIDs and s-words. */ /* */ /* */ /* CHANGE ACTIVITY: */ /* $L0= HOYB100 010803 DMGPLDM: Locate duplicate s-words */ /* */ /*********************************************************************/ signal on syntax /* Trap syntax errors and */ /* control line parameter errors */ exec_fmid='HOYB100' /* Set current maintenance level */ parse source . . execname . /* Get exec name */ if blgtrace=1 then /* TSP/TSX tracing requested? */ do /* Enable tracing */ say '**** Entering' left(execname,8) '(level='exec_fmid') ****' trace_option='Results' /* Set trace option */ end /* Enable tracing */ else /* TSP/TSX tracing not requested */ trace_option='Normal' /* Use default trace option */ trace (trace_option) /* Use requested trace option */ /********************BEGIN USER MODIFIABLE AREA***********************/ /* The following variables define base TSD390 commands used by this */ /* code. If you have used the COMMAND record to change the name of */ /* these commands, then change the values here. Make sure the */ /* commands you use are in uppercase and have no leading or */ /* trailing blanks. You may change the information between the */ /* single quotes. Do not make any changes on the left hand side of */ /* the equal sign. For example, if you have used the COMMAND record */ /* to rename the INITIALIZE command to the BEGIN command, the */ /* variable init_command would now be defined as: */ /* init_command = 'BEGIN'; */ /*********************************************************************/ cancel_command = ';CANCEL' search_command = ';SEARCH' display_command = ';DISPLAY R' suspend_command = ';SUSPEND' resume_command = ';RESUME' /*********************************************************************/ /* The following variables define base TSD390 IRC keystrokes used by */ /* this code. Please verify that the IRCs below match the customized*/ /* panel flow on your system or change as necessary. If you */ /* determine that a change is necessary, you may change the */ /* information between the single quotes. Do not make any changes */ /* on the left hand side of the equal sign. For example, if the */ /* keystroke sequence to switch from MANAGEMENT to SYSTEM is 98,1 */ /* instead of 3,1, the variable create_command would now be defined */ /* as: */ /* create_command = '98,1,5,2,2'; */ /*********************************************************************/ /* */ /* NONE */ /* */ /*********************************************************************/ debug = 0 /* No debugging messages DEBUG = 0 */ /* General debugging messages DEBUG = 1 */ /********************END USER MODIFIABLE AREA*************************/ /* Verify that the user is on the display summary panel for */ /* data view records. TSX should only be run in display mode */ /* because we're going to sort the data attribute record names */ /* and we don't want the change to be permanent. */ if tscacpnl /= 'BLG0VQ60' then do msgtxt = 'TSX: BLGTXDUP must run on the Data View' msgtxt = msgtxt||' Record display summary panel.' call blgtsx 'MESSAGE',,msgtxt,'SAVE' Signal EndTSX end /* Display the list of data attribute records and sort column 1 */ /* which is the data attribute record names. */ call blgtsx 'READDICT',S10B2 /* Use s-word for selection 3.*/ call blgtsx 'PROCESS',TSCARSD||',;SORT 1','DISCARD' possible_dups = '' old_one = '' /* XIM0DARC is the root s-word associated with the list of data */ /* attribute records. */ s_word = 'BC'x || 'IM0DARC' blg_list.0 = 0 /* Store the list of data attribute records for this data view */ /* record in the compound element blg_list. */ call blgtsx 'GETLIST',s_word if blg_list.0 = 0 then do /* This data view record does not specify any data attribute */ /* records. */ Call issuemsg 'SAVE',20210,'GETLIST',TSCAFRET,TSCAFRES Signal EndTSX end /* There are data attribute records...process them. */ do i = 1 to blg_list.0 if old_one = blg_list.i then /* Same attribute record RNID in list more than once. */ say 'Data Attribute rnid='blg_list.i, 'found more than once in list.' old_one = blg_list.i irc = suspend_command||','display_command blg_list.i /* Display the current attribute record. */ call blgtsx 'PROCESS',irc,'DISCARD' /* Verify that the user is on the data attribute display */ /* summary panel. */ if tscacpnl /= 'BLG0VQ70' then do blg_list.i = 'Not found' blg_list.i msgtxt = 'TSX: BLGTXDUP Could not display Data Attribute' msgtxt = msgtxt||' Record' blg_list.i'.' call blgtsx 'MESSAGE',,msgtxt,'SAVE' call blgtsx 'PROCESS',resume_command,'DISCARD' iterate i end /* Locate the data attribute record s-word. */ call blgtsx 'FINDSDATA','SWIN/.','DATA','FIRST' s_word = tscasdf swin = 'SWIN/' || tscasdf /* Search for other data attribute records with the same s-word.*/ call blgtsx 'PROCESS',search_command|| swin,'DISCARD' select /* This condition implies that the SWIN/ is not cognized or */ /* some serious error has occurred. */ when tscatplc = 0 then do msgtxt = 'TSX: BLGTXDUP No SWIN/ for Data Attribute' msgtxt = msgtxt||' Record' blg_list.i'.' call blgtsx 'MESSAGE',,msgtxt,'SAVE' blg_list.i = 'Missing SWIN/' blg_list.i end /* Only 1 data attribute record contains the s-word...this */ /* one. No error. Check next data attribute record/s-word. */ when tscatplc = 1 then blg_list.i = ''; /* Multiple data attribute records contain the s-word. */ otherwise /* Check the string for the s-word. The s-word won't be */ /* in the string unless it is a duplicate. */ if pos(s_word,possible_dups) = 0 then /* Build a string that contains the attribute record */ /* names followed by the s-words separated by blanks. */ /* Example: BLM&REQN=S0B59 BLM&STAT=S0BEE */ /* Add the current data attribute record and s-word to */ /* the string. */ possible_dups = possible_dups blg_list.i'='s_word else do /* Duplicate found. Inform the user. */ say '********* S-WORD =' s_word 'is a dup *********' temp = possible_dups do until temp = '' /* Find the attribute record RNIDs for the duplicate */ /* s-words. */ parse var temp rnid '=' dup temp if dup = s_word then say '* RNIDs' rnid 'and' blg_list.i 'are dups *' end /* end do until loop */ say '******************************************' end /* end else */ end /* end select */ call blgtsx 'PROCESS',resume_command,'DISCARD' end /* end do i loop */ EndTSX: if tscacpnl = BLG0DATT then /* Go back to summary panel. */ call blgtsx 'PROCESS',cancel_command,'DISCARD' if blgtrace=1 then /* TSP/TSX tracing requested? */ say '**** Leaving' left(execname,8) '(level='exec_fmid') ****' exit /*********************************************************************/ /* Subroutine to issue a message */ /* arg(1)=Message Type, arg(2)=Message ID, arg(3..n)=message inserts */ /*********************************************************************/ issuemsg: if arg(1)='SAY' then /* If message type is SAY */ msgtype = 'BUILD' /* treat as BUILD for ctlline */ else /* a message type other than say */ msgtype=arg(1) /* arg 1 is message type */ insert.1=execname /* use TSX name as parameter 1 */ inscnt=1 /* TSX name is insert number 1 */ do argno=3 to arg() /* copy args into insert. stem */ inscnt = inscnt+1 /* increment insert counter */ insert.inscnt=arg(argno) /* copy next arg into insert. var*/ end CALL BLGTSX 'MESSAGE',arg(2),,msgtype,,'INSERT.',inscnt if arg(1)='SAY' then /* if message type is say */ say tscavda /* output the message */ return /*********************************************************************/ /* Subroutine to display helpful information in the event of a */ /* syntax or TSX control line parameter error */ /*********************************************************************/ syntax: errsigl=sigl /* Save failing line number */ call issuemsg 'SAY',20200,sigl /* Show failing line number */ say strip(SourceLine(errsigl),'T') /* and the line source */ if symbol('BLG_ERROR.0')='VAR' then /* Control line errors? */ do i = 1 to BLG_ERROR.0 /* Loop through the messages */ say BLG_ERROR.i /* Display error message */ end exit 8