test: proc options(main); %include mdm_mkdate; %include mdm_openf; %include mdm_readf; %include mdm_writef; %include mdm_closef; %include mdm_strans; %include mdm_rwndf; %include _mdmdef; %include $stsdef; %include sys$bintim; DECLARE LIB$PUT_OUTPUT ENTRY (CHARACTER(*) VARYING); DECLARE dt_str CHARACTER(64) VARYING, line CHARACTER(128) VARYING, resspec char(255) varying, (lin2, lin3) CHARACTER(128) VARYING, vms_dt BIT(64) ALIGNED, i FIXED BINARY, dtslen FIXED BINARY(15), unit FIXED BINARY(31); /********************** BEGIN EXECUTABLE CODE *********************/ on endfile(sysin) goto aftertime; timeloop: put skip; get edit(dt_str) (col(1), a(64)) options(prompt('d/t: ')); if length(dt_str) = 0 then goto aftertime; sts$value = sys$bintim((dt_str), vms_dt); sts$value = mdm_mkdate(vms_dt, dt_str,); CALL ckerr('mkdate'); call lib$put_output('Date = ' || dt_str); goto timeloop; aftertime: sts$value = mdm_mkdate(, dt_str, dtslen); CALL ckerr('mkdate'); call lib$put_output('Length = ' || trim(char(dtslen)) || ', date = ' || substr(dt_str, 1, dtslen)); sts$value = mdm_openf(mdm_m_write, 'TEST_FILE', unit, '.TEST', resspec); CALL ckerr('openf - write'); call lib$put_output ('Write- result filespec = ' || resspec); sts$value = mdm_writef(unit, 'Hello there!'); CALL ckerr('writef'); sts$value = mdm_writef(unit, 'Hello there!'); CALL ckerr('writef'); sts$value = mdm_closef(unit); CALL ckerr('closef'); unit = 0; sts$value = mdm_openf(mdm_m_read, 'TEST_FILE', unit, '.TEST', resspec); call lib$put_output ('Read - result filespec = ' || resspec); CALL ckerr('openf - read'); DO i = 1 TO 2; sts$value = mdm_readf(unit, line,); CALL ckerr('readf'); call lib$put_output('Read in: ' || line); END; sts$value = mdm_rwndf(unit); CALL ckerr('rwndf'); sts$value = mdm_readf(unit, line, dtslen); call ckerr('readf2'); call lib$put_output('Read in (len='||trim(char(dtslen))||'): '|| substr(line, 1, dtslen)); sts$value = mdm_closef(unit); call ckerr('closef2'); lin2 = line; sts$value = mdm_strans(mdm_m_ascebc, lin2, lin3); call ckerr('ascebc'); lin2 = ''; sts$value = mdm_strans(mdm_m_ebcasc, lin3, lin2); call ckerr('ebcasc'); call lib$put_output('Translated to and from ebcdic: ' || lin2); lin3 = ''; sts$value = mdm_strans(mdm_m_ascpri, lin2, lin3); call ckerr('ascpri'); lin2 = ''; sts$value = mdm_strans(mdm_m_priasc, lin3, lin2); call ckerr('priasc'); call lib$put_output('Translated to and from primeascii: ' || lin2); call lib$put_output('*** Test passed! ***'); stop; ckerr: procedure(s); dcl s char(*) varying; dcl lib$stop entry (fixed binary(31) value); if sts$success then return; call lib$put_output('*** Problem with routine: ' || s); call lib$stop(sts$value); end; end test;