The julian date values starts at column 22 & 41 .I want to convert the Julian date to Gregorian date (YYYYMMDD) by some utility. I need this conversion for around 10000 rows everyday.
Also please suggest way to find the difference in times (Que_time & St_time) for the in In_Queue time of the jobs.
The output should be like this (In_Queue_time hhmmss)
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jan 08, 2004 10:59 am Post subject:
Shiva,
The following DFSORT JCl will give you the desired results. I asumming that you have the latest versions of either DFSORT or syncsort. A brief explanation of the job. We are using date parm DT1 to convert the date. the source to DTn formats is a 4-byte packed decimal format(P'cyyddd'). The c in the date source P'cyyddd' represents the century. It is converted as follows: 0 is converted to 19, 1 is converted to 20, and 2 or greater is converted to 21. so using a change command we change the century portion. And using outrec fields we change the zoned decimal date to packed decimal and using OUTREC we edit mask the date field to the desired format. I am assuming that your input file is of 80 bytes in length is of FB format.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jan 08, 2004 12:26 pm Post subject:
shiv,
The calculation between two times gets tricky when you involve the seconds portion also into it. you need to convert everything to secs and then get the difference between them in seconds. Then once again you need to convert the difference back to hours and mins.
The calculation in seconds can be done in sort but it would be too complicated.It gets complicated when the start time of the JOb is on the end of the year. Let us take this example
JOB a starts on 10:00:32 PM on DEC 31st 2003 and ends on 02.30:22 AM on Jan 1st 2004. Now your jobstats for this job would be as follows:
Now the time difference is 4 hours 29 mins 50 secs.
In order to get the you need to consider the year , date, hour, min and seconds.
Ideally I would code a cobol program to calculate the time difference using language environment callable services like CSEESECS.
If you don't care about the seconds , then the following JCL will give you the time difference in mins.This job will also perform the date conversion in addition to calculating the time difference.
Thanks a lot.You are great !!!
I could not connect to mainframe for more than a week after I up the post.Sorry for the late response to your solution.
I have SYNCSORT at my shop & tried running the above solution,
It works wondefull well.
Regards,
Shiv
_________________
Why Walk when you can Run ?
Nicola Iacocca
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Nov 16, 2009 6:05 pm Post subject:
shiv_swami,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the new date conversion function TOGREG like shown below to get the desired results
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum