I tried searching through the forum for example but couldnot find anything relevant for this. I was thinking of using IFTHEN in condition in the OUTREC statement. Thought of checking if there are any other efficient methods are available.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Most of what you want is simple rearranging. To change the months to numbers, look at CHANGE, which will be more effective than FINDREP with INOUT. For your PM you will need to add 12, with the output of ZD with a length of two, or use an EDIT (like TT).
The potential leading space in the hours can be changed to a '0' with another CHANGE, with a default for non-space of the original value.
Just have one small question - Is there any way to ignore the lower cases. In this I have to build the sort with only lower cases since the input file contains smaller cases. (This is not a real big issue, but anyhow the above sort solves the requirement).
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Why do you want the NOMATCH for the monts? What's your actual problem with the months and lower-case?
If you use CHANGE for the blank parts o the hours (first character of time) won't that do it? Then your IFTHEN is just for PM less than 12?
Why jam all your code together like that? You worked from magesh23586's example, which has better formatting than most, then decided to make it harder to read and change?
If you follow my suggestions, you'll greatly reduce the amount of code. Why not make what is left easier to read?