In my requirement I am facing one condition difficulty.
My requirement is from multiple duplicate record it should pic latest record based on timestamp.
In the below input I have 5 records, three records are same but timestamp differ and two records are completely different. In that three records I need to pic a record which has latest timestamp. Observe the following output.
Can anyone suggest using Cobol or JCL.
456&67 520 vshjsjw 2012-10-01.098908
456&67 520 vshjsjw 2012-10-01.102122
456&67 520 vshjsjw 2012-10-01.112321
456&43 530 vshjsjw 2013-10-01.098908
456&54 540 vshjsjw 2014-10-01.098908
1. It cannot be done in JCL. JCL only allocates resources and executes programs -- so you cannot write a JCL to pick records -- PERIOD.
2. Write a COBOL program. Seriously, if you do not understand the IF statement in COBOL and how to use it to simply and easily resolve your problem, you belong on The Beginner's and Students Forum, not on this forum which is for experts and people with mainframe experience. The question you asked in your post today is a beginner's question. You most likely will not get a lot of help on this forum for your question as those people who respond understand that you don't know COBOL and hence any help provided isn't likely to do much good without a LOT of follow up.
3. Terminology is critical in IT where similar terms may mean very different things. Your topic title and post statements use the term "pic" -- which is an abbreviation in a COBOL program for PICTURE -- yet the context indicates that you meant "pick". When you cannot use proper English capitalization and cannot spell a four-letter word correctly, you DEFINITELY belong on the Beginner's Forum and should not be posting on this forum for quite a while. Using appropriate English rules and spelling indicates a respect for the time of the people who respond on this forum, since they don't have to spend the time figuring out what you meant and can directly proceed to answering your question.