You can find the missing records with key and seqnum got incremeneted and other-fields filled with zero . Here we need to take care the comparison of key with next record/Group and seqnumshould be incremented accordingly. If it is different key then we need to store the key as well as corresponding seqnum and increment should be happen accordingly. I tried with sample JCL , can any please help me .
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
balaji81_k wrote:
[...]
You can find the missing records with key and seqnum got incremented and other-fields filled with zero . Here we need to take care the comparison of key with next record/Group and seqnum should be incremented accordingly. If it is different key then we need to store the key as well as corresponding seqnum and increment should be happen accordingly.
[...]
I'm confused about this.
Are you saying there are records there (and not showing them in your sample data) which just need the correct sequence numbers? This is "supported" in some part by your Control Cards not even attempting to insert any new data.
Or, is your sample data correct, you have no clue how to go about the task, but still feel someone who can do it is unable to do it without instruction, or has to do it your way?
I am still working on it and i have just written a base JCL to achieve the requierement, Yes i need to make some changes in JCL to achieve desired output based on the sample input data which i have put in?.
Can you please help me with JCL to get the desired output which i have given?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You need to "create" records. You can only do that in OUTFIL. You cannot do it a "variable" number of times, so you need code for each number of records that you want to create. The created records need to be correctly sequenced.
Have you considered writing a program to do this? It is not a difficult task for a program.
From sample input data , Records with KEY "AAA" is missed with Seq numbers "02,03,04" . While writing the output i need to write/insert key "AAA" with missed seqnums and other-fields to be zeros.
I am working on the logic to store key and seqnum and increment the seq num based on the missing records which considered for the Keys "AAA" and "BBB".
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
As Mr. Woodger indicates, it can be done, but would be a complex and tedious task. If this is a purely intellectual challenge, why ask for "JCL" (by which you mean control cards); if not, why the resistance to programming?
I arrived the results by making code changes in COBOL module , instead of having that code change, i tried to change a Job to have a one more step to arrive at the same results .
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, I understand what you want.
I'm saying, as has been accurately suggested to you, that because Sort Control Cards operate in a different "way" from a general-purpose programming language, there is "extra effort" (both in thinking and in the amount of code) in achieving solutions where the requirement better fits a g-p language.
It is the opposite where the requirement best fits Sort Control Cards. You will be able to do it in a g-p language, but not as "efficiently" in terms of thinking or coding.
(Efficiently in terms of running can be different, as Sort has much faster IO).
What is the maxium possible "range" of the missing numbers? Might you get two, or more, "ranges" of missing numbers per key?
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
1) No - you cannot do it with JCL which only tells the OS which program(s) you wantr to run and what resources are required.
2) You can possibly do it with your sort product if you use the correct sort control cards.
3) In your first post you say you have 2 keys, AAA & BBB, and that the second start with a seq number of 11. What, then is the record with a key of BBB and seq number of 10?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
balaji81_k,
Assuming you only have 2 digits numbers for the sequence number, the following DFSORT JCL will give you the desired results. I only showed upto 3 missing numbers. However you can expand that upto your max number provided you have storage availability. I assumed your input has RECFM=FB and LRECL=40
Learned so many things from your sort , thanks a lot for ur help !!.
If the input is of hundred's records it is fine but in production we have million of recs to process , so we need to increment the build logic accordingly . So we incorporate logic changes in COBOL Module.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
balaji81_k wrote:
Thanks Skolusu
Learned so many things from your sort , thanks a lot for ur help !!.
If the input is of hundred's records it is fine but in production we have million of recs to process , so we need to increment the build logic accordingly . So we incorporate logic changes in COBOL Module.
Thanks a lot !!!
Thanks
Balaji K
Well there are couple of other ways to generate the missing records, however would need an additional pass.