Kbase P168774: Table name over 14 characters in tabanalys wraps on line
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/13/2010 |
|
Status: Unverified
SYMPTOM(s):
Table name over 14 characters in tabanalys wraps on line
Can't import tabanalys into excel with long table name.
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
CAUSE:
Enhancement Request# 0000004071
FIX:
To work around this, once the tabanalys output has been generated, one can use the following code to read in the file and truncate the table names in PUB that are fourteen characters or longer:
DEFINE VARIABLE cString AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPartial AS CHARACTER NO-UNDO.
DEFINE VARIABLE lPartial AS LOGICAL NO-UNDO.
DEFINE VARIABLE iLoc AS INTEGER NO-UNDO.
DEFINE VARIABLE cTemp AS CHARACTER NO-UNDO.
DEFINE VARIABLE iDot AS INTEGER NO-UNDO.
DEFINE VARIABLE cFirstNum AS CHARACTER NO-UNDO.
DEFINE VARIABLE iSpaces AS INTEGER NO-UNDO.
/* Substitute file names for the INPUT FROM and OUTPUT TO */
INPUT FROM <tabanalys_output>.
OUTPUT TO <finished_file>.
REPEAT:
IMPORT UNFORMATTED cString.
/* This assumes all your tables are in PUB. If they are in some
other schema you may have to massage this code a bit to account for
the length of the schema name */
IF TRIM(cString) BEGINS "PUB." THEN DO:
iDot = INDEX(cString,".").
/* Get the table name without "PUB." */
cTemp = SUBSTRING(cString,
iDot + 1,
INDEX(cString,
" ",
iDot) - (iDot + 1)).
IF LENGTH(cTemp) GT 13 THEN DO:
ASSIGN iLoc = INDEX(cString,"PUB")
cPartial = SUBSTRING(cString,1,iLoc + 16)
lPartial = TRUE.
NEXT.
END.
END.
IF lPartial THEN DO:
cFirstNum = SUBSTRING(TRIM(cString),1,INDEX(TRIM(cString)," ")).
iSpaces = (12 - LENGTH(cFirstNum)).
ASSIGN cString = cPartial + FILL(" ",iSpaces) + TRIM(cString)
lPartial = FALSE.
END.
PUT UNFORMATTED cString CHR(10).
END.
OUTPUT CLOSE.
INPUT CLOSE.