Author: balaji81_k
Subject: Getting low values in output file
Posted: Wed Oct 19, 2016 1:26 am (GMT 5.5)
Hi Every one ,
I am able to see the output in my file . However I am seeing the low values in my output file at column 23rd position(i,e) after date format(YYYY.MM.DD) .Not sure what is the issue . Can any one help me on this?
Output file:-
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.
Subject: Getting low values in output file
Posted: Wed Oct 19, 2016 1:26 am (GMT 5.5)
Hi Every one ,
I am able to see the output in my file . However I am seeing the low values in my output file at column 23rd position(i,e) after date format(YYYY.MM.DD) .Not sure what is the issue . Can any one help me on this?
Code: |
SELECT ( SELECT WHEN CURRENT_TIME <= '00:59:59' THEN CAST(VARCHAR_FORMAT(CURRENT_DATE - 1 DAY,'MM/DD/YYYY') AS CHAR(10)) ||CAST('|' AS CHAR(1)) ||CAST(VARCHAR_FORMAT(CURRENT_DATE - 1 DAY,'YYYY.MM.DD') AS CHAR(10)) ||CAST('|' AS CHAR(1)) ELSE CAST(VARCHAR_FORMAT(CURRENT_DATE,'MM/DD/YYYY') AS CHAR(10)) ||CAST('|' AS CHAR(1)) CAST(VARCHAR_FORMAT(CURRENT_DATE,'YYYY.MM.DD') AS CHAR(10)) ||CAST('|' AS CHAR(1)) END FROM SYSIBM.SYSDUMMY1) AS A, CAST('|' AS CHAR(1)), SUBSTR(DIGITS(COL2),9,2), CAST('|' AS CHAR(1)), CASE WHEN GREGORIAN_DATE = DATE(CURRENT_TIMESTAMP - 1 HOUR) AND COL2 = HOUR(CURRENT_TIME - 1 HOUR) THEN CAST ('CURRHOUR' AS CHAR(8)) WHEN GREGORIAN_DATE = DATE(CURRENT_TIMESTAMP - 2 HOUR) AND COL2 = HOUR(CURRENT_TIME - 2 HOUR) THEN CAST ('PREVHOUR' AS CHAR(8)) WHEN GREGORIAN_DATE = CURRENT_DATE AND COL2 >= HOUR(CURRENT_TIME) THEN CAST('OPENHOUR' AS CHAR(8)) ELSE CAST('CLSDHOUR' AS CHAR(8)) END, CAST('|' AS CHAR(1)), SUBSTR(DIGITS(HOUR(CURRENT_TIME - 2 HOUR)),9,2) CAST('|' AS CHAR(1)), SUBSTR(DIGITS(HOUR(CURRENT_TIME - 1 HOUR)),9,2) CAST('|' AS CHAR(1)) FROM TEST.CALENDER_TABLE , (SELECT 00 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 01 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 02 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 03 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 04 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 05 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 06 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 07 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 08 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 09 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 12 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 13 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 14 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 15 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 16 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 17 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 18 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 19 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 20 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 21 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 22 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 23 AS COL2 FROM SYSIBM.SYSDUMMY1 UNION ALL) AS A WHERE GREGORIAN_DATE = CURRENT_DATE ORDER BY GREGORIAN_DATE,COL2 WITH UR; |
Output file:-
Code: |
10/18/2016|2016.10.18|.|00|CLSDHOUR|12|13| |
_________________
dear peoples,
i want to join these this group in order to
enrich my knowledge in mainframe.