This procedure converts a formatted numeric time passed as a parameter to the procedure to the format HHMMSS. The numeric time must be formatted according to the numeric time format template defined in the designated convention.
Example
This example converts a time from ASERIESNATIVE numeric form to standard input form. The ASERIESNATIVE ccsversion is used.
BEGIN
$ INCLUDE INTL="*SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 49999999
FILE OUT(KIND=DISK,UNITS=CHARACTERS,MYUSE=IO,FILETYPE=0,NEWFILE,
MAXRECSIZE=80,TITLE="OUT/ALGOL/CNVCONVERTTIMSTAR.");
DEFINE MAX_NAME_LEN = 17#; % Maximum length of convention
% name
EBCDIC ARRAY CNV_NAME[0:MAX_NAME_LEN - 1], CT_ARY[0:7], TIME_ARY[0:5];
INTEGER VSN_NUM, CT_ARY_SIZE, CNV_NAME_SIZE, TIME_ARY_SIZE, RESULT;
VSN_NUM := 0;
REPLACE CT_ARY BY "11:49:58";
REPLACE CNV_NAME BY "ASERIESNATIVE";
CT_ARY_SIZE := SIZE(CT_ARY);
CNV_NAME_SIZE := SIZE(CNV_NAME);
TIME_ARY_SIZE := SIZE(TIME_ARY);
RESULT := CNV_CONVERTTIME_STAR(VSN_NUM, CT_ARY, CT_ARY_SIZE,
CNV_NAME, CNV_NAME_SIZE,
TIME_ARY, TIME_ARY_SIZE);
WRITE(OUT,<"RESULT = ",J4>,RESULT);
IF RESULT EQL CS_DATAOKV THEN
WRITE(OUT,<"TIME_ARY = ",C6>,TIME_ARY);
CLOSE(OUT,LOCK);
END.Output
RESULT = 1 TIME_ARY = 114958
In this call, the parameters have the following meanings:
VSN_NUM is an integer passed to the procedure. It contains the ccsversion number that was in effect when the time was formatted. If the input string contains alternate digits, then they will be translated to their corresponding 0-9 numbers. Refer to the MultiLingual System Administration, Operations, and Programming Guide for a list of the ccsversion numbers. The values allowed for VSN_NUM and the meanings of the values are as follows:
|
Value |
Meaning |
|
Greater than or equal to 0 |
Use the specified ccsversion number. |
|
–2 |
Use the system default ccsversion. If the system default ccsversion is not available, an error is returned. |
CT_ARY is an EBCDIC array passed to the procedure. It contains the formatted time.
CT_ARY_SIZE is an integer that contains the total number of bytes in CT_ARY.
CNV_NAME is an EBCDIC array passed to the procedure. It contains the name of the convention that was used to format the input time. If this parameter contains all blanks or zeros, the procedure uses the hierarchy to determine the convention to be used. Refer to the MultiLingual System Administration, Operations, and Programming Guide for the list of convention names and an explanation of the hierarchy.
CNV_NAME_SIZE is an integer that contains the total number of bytes in CNV_NAME.
TIME_ARY is an EBCDIC array returned by the procedure. It contains the converted time in the form HHMMSS.
TIME_ARY_SIZE is an integer that contains the total number of bytes in TIME_ARY.
RESULT is an integer returned by the procedure. It indicates whether or not an error occurred during the execution of the procedure. An explanation of the error result values and messages can be found at the end of this section. The values returned by this procedure include:
|
CS_ARRAY_TOO_SMALLV (3001) |
CS_BAD_12HOURV (3052) |
|
CS_BAD_ARRAY_DESCRIPTIONV (3000) |
CS_CONVENTION_NOT_FOUNDV (2002) |
|
CS_BAD_DATA_LENV (3002) |
CS_DATA_NOT_FOUNDV (4002) |
|
CS_BAD_HOURV (3051) |
CS_DATAOKV (1) |
|
CS_BAD_MINUTEV (3053) |
CS_FAULTV (1001) |
|
CS_BAD_PSECONDV (3055) |
CS_FILE_ACCESS_ERRORV (1000) |
|
CS_BAD_SECONDV (3054) |
CS_NO_TIMEINPUTV (3056) |
|
CS_BADTIMEINPUTV (3013) |
CS_SOFTERRV (1002) |
|
CS_BAD_TIMESEPARATORV (3050) |

