Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Sathish Gurumoorthy,
Sort products do not have the ability to produce the day of week from a given date. However with a bunch of IFTHEN statements we can get the day of the week. In order to help you with that I need to know the LRECL and RECFM of the input dataset along with the position and format of the date field.
Rgupta71,
Please read the question once again and try to answer the question. If you can't test your solution please do NOT post the solution. Satish does NOT have the numerical value of the day of the week in the input. He just have a date field and he needs it to be converted to a numerical number which represents the day of the week or literal name of the day of week.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Sathish Gurumoorthy,
The following JCL will give you the desired results. I did not do any do any kind of date validation as I assumed that your input has valid dates in CCYYMMDD format in 4 byte binary field at pos 19 in your input.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Sathish Gurumoorthy
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the new date conversion function WEEKDAY like shown below to get the desired results . This job also validates the dates. If an invalid date is found then the output will have asterisks