1 CDO_Edit_Strings If a CDO field element contains an edit string, CDO performs an automatic translation of the CDO edit string characters for the following languages that support edit strings: o COBOL o DATATRIEVE o PL/I o RPG Translation of CDO Edit Strings for Languages and Products shows how CDO translates edit string characters for COBOL picture clause characters, DIGITAL DATATRIEVE edit string characters, PL/I picture clause characters, and RPG edit word characters. The following four symbols are used in Translation of CDO Edit Strings for Languages and Products: o -Not supported; if the CDO character appears in a CDO edit string, no picture clause or edit string is generated for the language. o -Ignored; the CDO character is ignored for the language. However, if the CDO character appears in an edit string with other characters that can be translated, CDO will perform the appropriate translation for the other edit string characters. o -The CDO character has the same value as the previous character in the edit string. o <**>-Characters appearing after the CDO character in the edit string are not translated for the language. Table 6-1 Translation of CDO Edit Strings for Languages and Products CDO RPG Character Character COBOL DTR PL/I EDIT Type or String PICTURE EDIT PICTURE WORD Alphabetic A A A Alphanumeric T X T X X X Comma , , , , , Date, Day, D D and Time H J J M M N N P Q R W W Y Y % * Decimal . . . . . point Digit F 7 9 9 9 9 blank Encoded C -9 -9 R sign G +9 +9 T K +9 +9 I Exponent E E Floating S + + S - Z"string" See See See See the the the the Floating_ Floating_ Floating_ Floating_ Character Character Character Character help help help help topic. topic. topic. topic. - - - - - + + + + blank $ $ $ $ $ \ Literal "string" See the See the See the See the Literal_ Literal_ Literal_ Literal_ Characters Characters Characters Characters help help help help topic. topic. topic. topic. Logical B 9 9 9 blank Lowercase L Minus &"string" See the See the See the See the literal Minus_ Minus_ Minus_ Minus_ Literal_ Literal_ Literal_ Literal_ Character Character Character Character help help help help topic. topic. topic. topic. Minus (( )) - (( )) - - parentheses Missing ? <**> ? <**> <**> separator Repeat x(n) x(n) x(n) (n)x x count repeats n times. Uppercase U 2 Alphabetic_Character The edit string character A (uppercase letter A) is replaced by an alphabetic character from the field's content. The action taken when a character in the field is not alphabetic is language dependent. See the documentation for each language to determine the action taken when a digit or nonalphabetic character occurs. CDO Edit AAAA String: DTR Edit AAAA String: Field Value: WXYZ Edited WXYZ Value: You can use the repeat count edit string character to indicate that you want to repeat the edit string character A a certain number of times. The following two edit strings are equivalent: AAAA A(4) 2 Alphanumeric_Character The two alphanumeric edit string characters are T and X. 3 T_Long_Text_Character The edit string character T (uppercase letter T) allows you to display any characters from a field's content on one or more lines. The primary use of the T edit string is to print fields containing large amounts of text. The number of Ts in the edit string indicates the maximum number of characters to be printed on one line. For example, the edit string TTTTT indicates that a line of output will contain no more than five characters. If the field contains more characters than specified in the edit string, DIGITAL DATATRIEVE prints as many full words on the line as possible. (A word in this sense is a string of characters delimited by a space.) DIGITAL DATATRIEVE then prints the remaining characters on the following lines, if necessary. DIGITAL DATATRIEVE does not print out trailing spaces when you use a T edit string. DIGITAL DATATRIEVE prints only full words. It does not divide words unless a single word is longer than the maximum number of characters specified by the edit string. In that case, DIGITAL DATATRIEVE truncates some characters and prints them on the next line. CDO Edit TTTTT String: DTR Edit TTTTT String: Field value: 1234567890 Edited 12345 Value: 67890 You can use the repeat count edit string character to indicate that you want to repeat the edit string character T a certain number of times. The following two edit strings are equivalent: TTTTT T(5) 3 X_Any_Character The edit string character X (uppercase letter X) displays any character from the field's content. CDO Edit XXXXXXXXXX String: DTR Edit XXXXXXXXXX String: Field Value: fj32dj%^*I Edited fj32dj%^*I Value: You can use the repeat count edit string character to indicate that you want to repeat the edit string character X a certain number of times. The following two edit strings are equivalent: XXXXXXXXXX X(10) 2 Comma_Character In fields with nonnumeric values, the edit string , character (a comma) inserts a comma into the edited value. In fields with numeric values, the edit string comma character inserts a comma or suppresses a leading zero in the edited value. The following example shows how the comma character is inserted into the edited value when the edit string has a nonnumeric value. CDO Edit AA,AA String: DTR Edit AA,AA String: Field Value: ohno Edited oh,no Value: The following example shows how a comma character in a CDO edit string causes a comma to be inserted in the edited value. CDO Edit $$,$$9.99 String: DTR Edit $$,$$9.99 String: Field Value: 1234.56 Edited $1,234.56 Value: The following example shows what happens when a comma character is included in an edit string with numeric values, but the comma is not required in the edited value: CDO Edit $$,$$9.99 String: DTR Edit $$,$$9.99 String: Field Value: 12.34 Edited $12.34 Value: 2 Date_Day_and_Time_Characters The edit string characters described in this section are used to specify the output format of fields containing date, day, and time information. See Literal_Characters for an explanation of how products and languages handle characters enclosed by double quotation marks in CDO edit strings. 3 D_Day_Number_Character The edit string character D (uppercase letter D) displays a digit of the day within a month. You should repeat this character twice within an edit string. CDO Edit NN"/"DD"/"YYYY String: DTR Edit NN/DD/YYYY String: Field Value: May 4, 1996 Edited 05/04/1996 Value: 3 H_Twelve-Hour_Mode_Character The edit string character H (uppercase letter H) displays one digit of the hour, in 12-hour mode, in the edited value. You should repeat this character twice within an edit string. Do not use this character in edit strings containing the R (24- hour mode) character. CDO Edit HH":"PP" "%% String: Field Value: 11:30 a.m. Edited 11:30 AM Value: 3 J_Julian_Digit_Character The edit string character J (uppercase letter J) displays a digit of the Julian date in the edited value. You should repeat this character three times within an edit string. CDO Edit YYYY"/"JJJ String: DTR Edit YYYY/JJJ String: Field Value: June 4, 1980 Edited 1980/156 Value: 3 M_Month_Name_Character The edit string character M (uppercase letter M) displays a letter of the month name in the edited value. CDO Edit MMM" "DD" "YYYY String: DTR Edit MMMBDDBYYYY String: Field Value: May 4, 1980 Edited MAY 04 1980 Value: In the following example, the CDO edit string contains five M characters. If the month name in the field value contains more than five characters, only the first five characters of the month name are displayed in the edited value. CDO Edit MMMMM" "DD" "YYYY String: DTR Edit MMMMMBDDBYYYY String: Field Value: December 4, 1987 Edited DECEM 04 1987 Value: If the month name in the field value contains fewer than five characters, trailing blanks are displayed after the month name in the edited value. CDO Edit MMMMM" "DD" "YYYY String: DTR Edit MMMMMBDDBYYYY String: Field Value: May 4, 1980 Edited MAY 04 1980 Value: 3 N_Month_Number_Character The edit string character N (uppercase letter N) displays a digit for the number of the month in the edited value. You should repeat this character twice within an edit string. CDO Edit NN"/"DD"/"YYYY String: DTR Edit NN/DD/YYYY String: Field Value: May 4, 1985 Edited 05/04/1985 Value: 3 P_Minute_Character The edit string character P (uppercase letter P) displays one digit for the number of minutes in a time value in the edited field. You should repeat this character twice within an edit string. CDO Edit HH":"PP" "%% String: Field Value: 11:30 a.m. Edited 11:30 AM Value: 3 Q_Second_Character The edit string character Q (uppercase letter Q) displays one digit for the number of seconds in a time value in the edited value. You should repeat this character twice within an edit string. CDO Edit PP":"QQ"."** String: Field Value: 23 minutes 13.56 seconds Edited 23:13.56 Value: 3 R_Twenty-Four_Hour_Mode_Character The edit string character R (uppercase letter R) displays one digit of the hour, in 24-hour mode, in the edited value. You should repeat this character twice within an edit string. Do not use this character in edit strings containing the H character (12-Hour mode) character. CDO Edit RR":"PP String: Field Value: 2:30 p.m. Edited 14:30 Value: 3 W_Weekday_Name_Character The edit string character W (uppercase letter W) displays a letter from the day of week in a time value into the edited value. CDO Edit WWWWWWWWW String: DTR Edit WWWWWWWWW String: Field Value: June 3, 1987 Edited WEDNESDAY Value: You can use the repeat count edit string character to indicate that you want to repeat the edit string character W a certain number of times. The following two edit strings are equivalent. WWWWWWWWW W(9) 3 Y_Year_Character The edit string character Y (uppercase letter Y) displays a digit of the year in a time value into the edited value. You should repeat this character either two or four times in an edit string. CDO Edit MMM" "DD" "YY String: DTR Edit MMMBDDBYY String: Field Value: May 4, '85 Edited MAY 04 85 Value: The CDO edit string can also contain four Y characters. CDO Edit MMM" "DD" "YYYY String: DTR Edit MMMBDDBYYYY String: Field Value: May 4, 1985 Edited MAY 04 1985 Value: 3 %_AM/PM_Character The edit string character % (a percent sign) displays a character from one of the strings AM or PM in the edited value. You should repeat this character twice within an edit string. The edit string character % is most useful when used with the edit string character H (twelve-hour mode character) and when placed at the end of the edit string. CDO Edit HH":"PP" "%% String: Field Value: 11:30 a.m. Edited 11:30 AM Value: 3 *_Fraction_Second_Character The edit string character * (an asterisk) displays a value for fractions of a second within a time field in the edited value. Repeat this character twice within an edit string to denote hundredths of a second. CDO Edit MM":"QQ"."** String: Field Value: 23 minutes 13.56 seconds Edited 23:13.56 Value: 2 Decimal_Point_Character The edit string decimal point character . (a period) inserts a period into the edited value. You can use this character only once within an edit string for numeric fields. CDO Edit 99.99 String: DTR Edit 99.99 String: Field Value: 2813E-2 Edited 28.13 Value: 2 Digit_Characters You can represent hexadecimal (F), octal (7), and decimal (9) digits in edit strings. 3 F_Hexadecimal_Digit_Character The edit string character F (uppercase letter F) displays one hexadecimal digit in the edited value. Do not use the hexadecimal digital character (F) within an edit string containing the octal character (7) or the decimal character (9). CDO Edit FFF String: Field Value: 32 Edited 020 Value: 3 7_Octal_Digit_Character The edit string character 7 (the number seven) displays one octal digit in the edited value. Do not use the octal digit character (7) within an edit string containing the hexadecimal character (F) or the decimal character (9). CDO Edit 777 String: Field Value: 32 Edited 040 Value: 3 9_Decimal_Digit_Character The edit string character 9 (the number nine) displays one decimal digit in the edited value. Do not use the decimal digit character (9) within an edit string containing the hexadecimal character (F) or the octal character (7). CDO Edit 999 String: DTR Edit 999 String: Field Value: 613 Edited 613 Value: 2 Encoded_Sign_Characters The encoded sign edit string characters are the encoded minus edit string character (C), the encoded sign edit string character (G), and the encoded plus edit string character (K). 3 C_Encoded_Minus_Character If the field's value is negative, the encoded minus character C (uppercase letter C) overwrites the next digit with a minus sign (-), then moves the encoded digit to the edit string. If the field's value is positive or zero, this character moves the next digit into the edited string. Use this character only at the beginning or end of a string. An edit string can contain only one character designating a sign. Do not use this character within an edit string that contains other characters designating a sign. See the reference manual for the language or product that will interpret the edit string to determine how the language or product interprets encoded sign characters. CDO Edit C99 String: PL/I Picture R99 Clause: Field Value: -456 Edited M56 Value: 3 G_Encoded_Sign_Character If the field's value is positive, the encoded sign character G (uppercase letter G) overwrites the next digit with a plus sign (+), then moves the encoded digit to the edit string. If the field's value is negative, the encoded sign character (G) overwrites the next digit with a minus sign (-), then moves the encoded digit to the edit string. If the field's value is zero, the action of this character depends on the language. Use this character only at the beginning or end of a string. An edit string can contain only one character designating a sign. Do not use this character within an edit string that contains other characters designating a sign. See the reference manual for the language or product that will interpret the edit string to determine how the language or product interprets encoded sign characters. CDO Edit G99 String: PL/I Picture T99 Clause: Field Value: +123 Edited A23 Value: 3 K_Encoded_Plus_Character If the field's value is positive, the encoded plus character K (uppercase letter K) overwrites the next digit with a plus sign (+), then moves the encoded plus digit to the edit string. If the field's value is negative or zero, the encoded plus character (K) moves the next digit into the edited string. Use this character only at the beginning or end of a string. An edit string can contain only one character designating a sign. Do not use this character within an edit string that contains other characters designating a sign. See the reference manual for the language or product that will interpret the edit string to determine how the language or product interprets encoded plus characters. CDO Edit K99 String: PL/I Picture I99 Clause: Field Value: +123 Edited A23 Value: 2 Exponent_Character The edit string character E (uppercase letter E) divides an edit string into two parts for floating-point or scientific notation. The first part is the characteristic and mantissa edit string and the second part is the exponent edit string. CDO Edit S99ES99 String: DTR Edit +99E+99 String: Field Value: 1200 Edited +12E+02 Value: 2 Floating_Characters There are six edit string floating characters: S, Z, -, +, $, and \. 3 S_Floating_Sign_Character If you use the edit string character S (uppercase letter S) only once within an edit string, one of the following results can occur: o If the field's value is positive, the character S inserts a plus sign (+) into the edited value. CDO Edit S9 String: DTR Edit +9 String: Field Value: 6 Edited +6 Value: o If the field's value is negative, the floating sign character inserts a minus sign (-) into the edited value. CDO Edit S9 String: DTR Edit +9 String: Field Value: -8 Edited -8 Value: o If the field's value is zero, the effect of the floating sign character depends on the language reading the field. CDO Edit S9 String: DTR Edit +9 String: Field Value: 0 Edited +0 Value: If you use more than one floating sign character at the beginning of an edit string, the S character suppresses leading zeros before inserting a plus sign (+) or minus sign (-) into the edited value. CDO Edit SS99 String: DTR Edit ++99 String: Field Value: 0054 Edited +54 Value: You cannot use the S character within an edit string that contains another character designating a sign. 3 Z_Floating_Zero_Replace_Character If the digit within the field's value is zero, the floating zero replace character Z (uppercase letter Z) displays a literal value instead of the zero digit in the edited string. If the digit within the field's value is not zero, the floating zero replace character displays the digit. CDO Edit Z" "99 String: DTR Edit Z99 String: Field Value: 25 Edited 25 Value: The following example also shows the floating zero replace character. CDO Edit Z"*"99 String: DTR Edit *99 String: Field Value: 25 Edited *25 Value: Translation of Characters in Floating Zero Replace Edit Strings shows how CDO translates individual CDO characters in floating zero replace edit strings for other languages. Table 6-2 Translation of Characters in Floating Zero Replace Edit Strings CDO RPG Z String Character COBOL DTR PL/I EDIT Format in String PICTURE EDIT PICTURE WORD Z"string" blank Z Z Z or Y 0 * * * * * any other * * * * character See the PL/I documentation for an explanation of when the CDO blank character is translated to Z and when it is translated to Y. You cannot use the Z character within an edit string that contains another character designating a sign. 3 -_Floating_Minus_Character If you use the edit string floating minus character, a minus sign (-), only once within an edit string, one of the following results can occur: o If the field's value is positive, the floating minus character inserts a blank into the edited value. o If the field's value is negative, the floating minus character inserts a minus sign into the edited value. o If the field's value is zero, the effect of the floating minus character depends on the language reading the field. If you use this character a number of times at the beginning of an edit string, the character suppresses leading zeros before inserting a blank or minus sign into the edited value. You cannot use the minus character within an edit string that contains another character designating a sign. For a nonnumeric field, this character moves a minus sign into the edited value. CDO Edit -9 String: DTR Edit -9 String: Field Value: -54 Edited -54 Value: 3 +_Floating_Plus_Character If you use the edit string floating plus character, a plus sign (+), only once within an edit string, one of the following results can occur: o If the field's value is positive, the floating plus character inserts a plus sign into the edited value. o If the field's value is negative, the floating plus character inserts a blank into the edited value. o If the field's value is zero, the effect of the floating plus character depends on the language reading the field. If you use this character a number of times at the beginning of an edit string, the character suppresses leading zeros before inserting a blank or plus sign into the edited value. You cannot use this character within an edit string that contains another character designating a sign. CDO Edit +++9 String: DTR Edit +++9 String: Field Value: 54 Edited +54 Value: 3 $_Floating_Currency_Character If you use the floating currency character only once, it inserts the dollar sign ($) in the next character position in the edited value. If you supply the floating currency character more than once at the beginning of an edit string, it suppresses leading zeros. To suppress up to four leading zeros, supply the character four times at the beginning of the edit string. The floating currency character inserts the currency sign to the left of the first printed digit of the edited value. CDO Edit $,$$$.99 String: DTR Edit $,$$$.99 String: Field Value: 157.86 Edited $157.86 Value: 3 \_:_Floating_Blank_Character The floating blank character, a backslash (\), suppresses blanks from an edited value. If the value of the character is a blank, the edited value excludes it. CDO Edit MMM\\\\\,YYYY String: Field Value: June 15, 1982 Edited JUNE,1982 Value: 2 Literal_Characters A pair of double quotation marks (" ") are the edit string literal characters. Any character string enclosed by double quotation marks in an edit string is inserted into the edited value. CDO Edit 99" ""Hours" String: DTR Edit 99B'Hours' String: Field Value: 40 Edited 40 Hours Value: Translation of CDO Literal Edit Strings shows how CDO translates CDO literal edit strings for other languages. In the table, means that the language does not support the CDO character, and the character is ignored for the language. If the character appears in an edit string with other characters that can be translated, CDO will perform the appropriate translation for the other edit string characters. If CDO characters other than a blank, 0, /, or % occur in a string, CDO passes those characters to DIGITAL DATATRIEVE and RPG without performing a translation. If a CDO edit string consists of only a 0, /, %, or a blank, then CDO performs the appropriate translation as shown in the first four lines of the table. The last line of the table shows how CDO translates any other edit string for each language. For example, CDO translates the CDO edit string "sample string" to 'sample string' for DIGITAL DATATRIEVE. Note that the initial blank character in the CDO edit string does not become a B in DIGITAL DATATRIEVE except when the blank is the only character in the edit string. CDO translates characters from the first four lines of the table differently depending on whether or not they are the only characters in an edit string. Table 6-3 Translation of CDO Literal Edit Strings Literal RPG String CDO COBOL DTR PL/I EDIT Format String PICTURE EDIT PICTURE WORD "string" Blank B B B & 0 0 0 0 / / / / / % % % Any 'string' string other string 2 Logical_Character The edit string character B (uppercase letter B) is the logical character. It displays logical fields as either TRUE or FALSE. CDO Edit BBBBB String: Field Value: 0 Edited FALSE Value: 2 Lowercase_Character The edit string character L (uppercase letter L) prints any remaining alphabetic characters in a field's value in lowercase. CDO Edit LMMM" "DD String: Field Value: November 12th Edited nov 12 Value: 2 Minus_Literal_Character The minus literal character & (an ampersand) replaces a negative sign in a field's value with a literal you supply. If the field's value is positive, this character moves a blank to the string instead of the literal you supply. Do not use this character within an edit string that contains another character designating a sign. CDO Edit 99&"CR" String: DTR Edit 99CR String: Field Value: -15 Edited 15CR Value: Translation of CDO Minus Literal Edit Strings shows how CDO translates CDO minus literal edit strings for other languages. If CDO characters other than CR or DB appear in a string, CDO translates the string as a hyphen (-) for COBOL, DIGITAL DATATRIEVE, and PL/I. CDO passes any CDO character to RPG without performing a translation. Table 6-4 Translation of CDO Minus Literal Edit Strings Minus Literal RPG String CDO COBOL DTR PL/I EDIT Format String PICTURE EDIT PICTURE WORD &"string" CR CR CR CR CR DB DB DB DB DB Any - - - string other string 2 Minus_Parentheses_Character The edit string character (( )) (double opening and closing parentheses characters) is the minus parentheses character. It encloses negative values in parentheses. CDO Edit ((999)) String: DTR Edit ((999)) String: Field Value: -678 Edited (678) Value: 2 Missing_Separator_Character The edit string character ? (a question mark) is the missing separator character. If the field has a missing value attribute or relationship, this character separates two edit strings. If the field value is not the missing value, the first edit string controls the output of the field. If the contents of the field contain the missing value, the second edit string controls the output of the field. CDO Edit 999?"Unknown" String: DTR Edit 999?'Unknown' String: Field Value: missing value Edited Unknown Value: 2 Repeat_Count_Character The edit string character x(n) is the repeat count character. Replace x with the character that you want to repeat in an edit string. Replace n with a positive integer that indicates the number of times you want to repeat the character designated by x. CDO Edit W(9) String: DTR Edit W(9) String: Field Value: June 3, 1987 Edited WEDNESDAY Value: 2 Uppercase_Character The edit string character U (uppercase letter U) prints any remaining alphabetic characters in a field's value in uppercase. The following example shows a CDO edit string containing the U character, the field value, and the edited value that would be produced if a product supported these characters: CDO Edit UA(20) String: Field Value: Jones Edited JONES Value: 2 Japanese_Edit_Strings Oracle CDD/Repository supports edit string syntax that provides characters for DIGITAL VAX COBOL to handle Japanese edit strings in the PICTURE clause. Japanese edit string support is available in Oracle CDD/Repository Version 6.1 and later. When you specify N or B for an edit string, enclose it between square brackets ([ ]). Do not use these edit string characters for Oracle CDD/Repository field definitions that will be used from DIGITAL DEC COBOL.