>>And Ravi has clarified that he wants the technique to be aware of
Daylight Saving Time. And I recall the rules in the U.S. changed in 2006.
And more
recently in the Nation of Samoa.
Sigh. DFSORT (and DB2) ought to be savvy to:
https://www.iana.org/time-zones
(Java knows this. Linux knows this. ... )
Paul,
I am not sure as to what your gripe is but it is really sad to see you
complain on every bit of DFSORT when you don't realize the full potential
of its capability. May be it is time for your shop to pay for a training
class on DFSORT and I will be more than happy to show you its full
potential. Here is a small sample Job that calculates the Day light
savings begin date and end date and then adjust the offset according to
them and as well as gives the option for the user to pick whatever time
zone he wants these calculations to be based on. If the user does not pass
a time zone then it defaults to PST.
And just for your record, according to "National Institute of Standards
and Technology" the DST rules are changed in 2007.
http://www.nist.gov/pml/div688/dst.cfm
What are the current rules for daylight saving time?
The rules for DST changed in 2007 for the first time in more than 20
years. The new changes were enacted by the Energy Policy Act of 2005,
which extended the length of DST in the interest of reducing energy
consumption. The rules increased the duration of DST by about one month.
DST is now in effect for 238 days, or about 65% of the year, although
Congress retained the right to revert to the prior law should the change
prove unpopular or if energy savings are not significant. At present,
daylight saving time in the United States
begins at 2:00 a.m. on the second Sunday of March and
ends at 2:00 a.m. on the first Sunday of November
Please feel free to email if you have any further questions or you want to
know what else DFSORT can do.
>>>So here's the situation we have 5 way sysplex where 3 lpar's running
with the GMT timezone however 2 are running with separate asia time .one
is GMT -7 or 8 based on
daylight saving and another is GMT +7or 8 ...
Ravi,
Here is a DFSORT Job that give the desired results. You can pass the
timezone you prefer as SET parameter.
// SET TIMEZONE='EST'
//*
//STEP0100 EXEC PGM=SORT,PARM=('JP1"&TIMEZONE"')
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2016-03-13 01:59:59 << DST OFF |
2016-03-13 02:00:00 << DST ON |
2016-03-14 00:00:00 << DST ON |
2016-11-06 01:59:59 << DST ON |
2016-11-06 02:00:00 << DST ON |
2016-11-06 02:00:01 << DST OFF |
2016-11-07 00:00:00 << DST OFF |
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,
*** GET DAY LIGHT SAVINGS BEGIN DATE I.E 2ND SUNDAY OF MARCH **
OVERLAY=(081:DATE2, $ YYYYMM
085:C'0301', $ MARCH 1ST
081:081,8,Y4T,SUBDAYS,+1,TOGREG=Y4T, $ FEB LAST DAY
081:081,8,Y4T,NEXTDSUN,TOGREG=Y4T, $ 1ST SUN IN MARCH
081:081,8,Y4T,NEXTDSUN,TOGREG=Y4T, $ 2ND SUN IN MARCH
C'020000', $ 02:00:00 TIME
*** GET DAY LIGHT SAVINGS END DATE I.E 1st SUNDAY OF NOVEMBER **
096:DATE2, $ YYYYMM
100:C'1031', $ OCTOBER 31ST
096:096,8,Y4T,NEXTDSUN,TOGREG=Y4T, $ 1ST SUN IN NOV
C'015959', $ 01:59:59 TIME
*** CONCAT INPUT DATE AND TIME TO COMPARE THE DST TIME RANGE **
111:01,10,UFF,M11,LENGTH=8, $ DATE TO CCYYMMDD
15,08,UFF,M11,LENGTH=6, $ TIME TO HHMMSS
*** GET THE TIMEZONE FROM THE CUSTOMER INPUT ***
126:JP1,
*** SET THE OFFSET FROM THE TIMEZONE ***
130:126,3,CHANGE=(2,C'PST',C'08', $ PST IS GMT-8
C'MST',C'07', $ MST IS GMT-7
C'CST',C'06', $ CST IS GMT-6
C'EST',C'05'), $ EST IS GMT-5
NOMATCH=(C'08'))), $ NONE = 8
*** CHECK FOR DST START AND END DATES AND ADJUST THE OFFSET **
IFTHEN=(WHEN=((111,14,CH,GE,81,14,CH),AND, $ DST BEGIN
(111,14,CH,LE,96,14,CH)), $ DST END
OVERLAY=(130:130,2,ZD,SUB,+1,EDIT=(TT)), $ SUBTRACT 1
HIT=NEXT),
*** NOW PERFORM THE TIME - OFFSET CALCULATIONS **
IFTHEN=(WHEN=(130,1,FS,EQ,NUM),
OVERLAY=(134:(119,2,ZD,MUL,+3600,ADD, $ (HH * 3600 +
121,2,ZD,MUL,+0060,ADD, $ MM * 0060 +
123,2,ZD),SUB, $ SS) -
130,2,ZD,MUL,+3600,ZD,LENGTH=8), $ OFF * 3600
HIT=NEXT),
*** IF TIME IS NEGTIVE THEN ADJUST THE DATE AS DATE - 1 ***
IFTHEN=(WHEN=(134,8,ZD,LT,0),
OVERLAY=(134:134,8,ZD,ADD,+86400,ZD,LENGTH=8, $ ADD 24 HOURS
041:111,8,Y4T,SUBDAYS,+1,TOGREG=Y4T(-)), $ SUBTRACT 1 DAY
HIT=NEXT),
*** CONVERT SECOND BACK TO TIME FORMAT ***
IFTHEN=(WHEN=ANY,
OVERLAY=(53:134,8,ZD,DIV,+3600,EDIT=(TT), $ HH
C':', $ COLON
(134,8,ZD,MOD,+3600),
DIV,+60,EDIT=(TT), $ MM
C':', $ COLON
((134,8,ZD,MOD,+3600),
MOD,+60),EDIT=(TT))) $ SS
//*
The output from this job is
2016-03-13 01:59:59 << DST OFF |2016-03-12 20:59:59
2016-03-13 02:00:00 << DST ON |2016-03-12 22:00:00
2016-03-14 00:00:00 << DST ON |2016-03-13 20:00:00
2016-11-06 01:59:59 << DST ON |2016-11-05 21:59:59
2016-11-06 02:00:00 << DST ON |2016-11-05 22:00:00
2016-11-06 02:00:01 << DST OFF |2016-11-05 21:00:01
2016-11-07 00:00:00 << DST OFF |2016-11-06 19:00:00
Sri Hari Kolusu
DFSORT Development
IBM Corporation
Email: [email protected]
Phone: 520-799-2237 Tie Line: 321-2237
IBM Mainframe Discussion List <[email protected]> wrote on
02/03/2016 09:49:21 PM:
> From: Ravi Gaur <[email protected]>
> To: [email protected]
> Date: 02/03/2016 09:49 PM
> Subject: Re: DFSORT - SMF Records - GMT To EST
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> Thanks Kolusu,
>
> So here's the situation we have 5 way sysplex where 3 lpar's running
> with the GMT timezone however 2 are running with separate asia time
> ...one is GMT -7 or 8 based on daylight saving and another is GMT +7or 8
...
>
> Now requirement is to convert monthly collected the SMF Time and
> sync it before get processed so that we do not compare apple with
> oranges situation....
>
> Now I could certainly used the ERBCHGMT utility however issue with
> this I see is with every year we will have to make the JCL Changes
> and go through the change management cycle ...so instead of this was
> looking DFSORT where I have parm library mentioned with the Time/
> date so that with every daylight saving we adjust an hour
> accordingly without going lot of hassle..
>
> Now I ran the example you gave and used the ERBSCAN to look at the
> data before and after and see SMFTIME is coming out same , Do we
> have some way to ensure DFSORT is really converting the time?
>
> Rec-Num Type RecLn SMFDate SMFTime RMFDate RMFTime Int-Len
> SMFId/Vers S
> ------- ------- ----- ----------------- ----------------- ---------
> ---------- -
> 1 015 80 2015.306 00:00:19 xxxx
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN