@@ -1689,4 +1689,39 @@ public static AbstractCobolField funcNational(AbstractCobolField srcfield) {
16891689 currField .getDataStorage ().memcpy (pdata , ndata );
16901690 return currField ;
16911691 }
1692+
1693+ public static AbstractCobolField funcCombinedDatetime (
1694+ AbstractCobolField srcdays , AbstractCobolField srctime ) {
1695+ int srdays ;
1696+ int srtime ;
1697+ String str ;
1698+ byte [] buff = new byte [12 ];
1699+
1700+ CobolFieldAttribute attr =
1701+ new CobolFieldAttribute (CobolFieldAttribute .COB_TYPE_NUMERIC_DISPLAY , 12 , 5 , 0 , null );
1702+ AbstractCobolField field = CobolFieldFactory .makeCobolField (12 , (CobolDataStorage ) null , attr );
1703+ makeFieldEntry (field );
1704+ CobolRuntimeException .setException (0 );
1705+ srdays = srcdays .getInt ();
1706+ if (srdays < 1 || srdays > 3067671 ) {
1707+ CobolRuntimeException .setException (CobolExceptionId .COB_EC_ARGUMENT_FUNCTION );
1708+ currField .getDataStorage ().memset (0 , 12 );
1709+ return currField ;
1710+ }
1711+ srtime = srctime .getInt ();
1712+ if (srtime < 1 || srtime > 86400 ) {
1713+ CobolRuntimeException .setException (CobolExceptionId .COB_EC_ARGUMENT_FUNCTION );
1714+ currField .getDataStorage ().memset (0 , 12 );
1715+ return currField ;
1716+ }
1717+ str = String .format ("%7d%5d" , srdays , srtime );
1718+ buff = str .getBytes ();
1719+ for (int i = 0 ; i < 12 ; i ++) {
1720+ if (buff [i ] == 32 ) {
1721+ buff [i ] = 48 ;
1722+ }
1723+ }
1724+ currField .getDataStorage ().memcpy (buff );
1725+ return currField ;
1726+ }
16921727}
0 commit comments