View previous topic :: View next topic
|
Author |
Message |
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
I have an input file of length 20 bytes. This file has the key in the first 10 bytes and it takes up numeric format [9(10)]. This input file is not sorted in the order of the key and I'm trying to sort the input file and include one extra byte at the end of every record.
This extra byte has to be,
(i) 'Y', if the next record in the file will have the same key as that of the current record.
(ii) 'N', if the next record in the file will have the different key as that of the current record.
Could anyone help me with introducing this new byte at the end of the record ? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
can you give an example of input and expected output.
Gerry |
|
Back to top |
|
|
jsathishbabu84
New User
Joined: 07 Jun 2007 Posts: 22 Location: India
|
|
|
|
Hi,
What result you expect when there are multiple duplicate keys?
First record will have "Y", what value should the duplicate records have?
Regards,
Shrek |
|
Back to top |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
Please find below a sample input with the desired output,
Sample Input:
Code: |
1111111111ABCDEFGHIJ
2222222222AFDSFSDAFA
3122332323AFASDFADSF
1111111111AASDFDSFAD
3243431412DFADSFAASD
9999999999ASFADSFASF
3122332323AFASDFADSH
8888888888AFDSFASDFF
5666666666ASFDAFDSFA
9999999999ADFSDAFDFA
3122332323AFASDFADSG
3122332323AFASFDSFDD |
Desired Output:
Code: |
1111111111ABCDEFGHIJY
1111111111AASDFDSFADN
2222222222AFDSFSDAFAN
3122332323AFASDFADSFY
3122332323AFASDFADSHY
3122332323AFASDFADSGY
3122332323AFASFDSFDDN
3243431412DFADSFAASDN
5666666666ASFDAFDSFAN
8888888888AFDSFASDFFN
9999999999ASFADSFASFY
9999999999ADFSDAFDFAN |
As given above, the 21st byte will have the value 'Y' if the following record will have the same key as that of the current record. And it will have a value 'N' if the following record will have a different key from the current record. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And this entire copy of the file is being made so that the next program does not have to determine which is the last of the duplicates. . .
None of my clients would permit such a process . . .
fwiw |
|
Back to top |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
Dick, You nailed it perfectly. Thats the reason I was trying to do it. And the reason why I want this to be done is because, this file would be processed as a GSAM database in the next IMS program. And when I have to read the next record to identify if the current record is the last duplicate for the particular key, I was having some problem with my CHKP/XRST. (Though I have overcome this problem by using a RSA) my curiousity dint stopped me from trying to figure out if this is feasible using a sort utility and how simple could it be. And hence I was trying to read some manuals to see if there would be any keyword with which I can achieve this functionality. But my efforts were in vain. When I end up in a confused state finding something, there is always one place where I end up - IBMMainframes.com :-) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Thats the reason I was trying to do it. |
I don't know about your data volumes, but much of the data we process is in the 10's or 100's of millions of records and the extra dasd space and cpu time would cause problems. . .
Quote: |
And when I have to read the next record to identify if the current record is the last duplicate for the particular key, I was having some problem with my CHKP/XRST. |
Usually, this is treated as a "control break" and the prior group is "wrapped up" when the key changes.
As this is a batch process, you might consider not using checkpoint/restart. . . With the newer, faster cpu's and dasd, many places have stopped using checkpoint/restart. It is often faster and more reliable to reload (if needed) and rerun. This also eliminates the need to syncronize sequential outputs and reports. |
|
Back to top |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
Hello,
In cases where the total number of records are in millions, I understand the complexity. My job processes about few hundred of thousands of records in the batch process every day.
And regarding your suggestion on CHKP/XRST - it gives me a whole new dimension of looking into the problem now. My shop currently uses IMS 9.1 and would be upgrading shortly. The interesting fact is that our application has been running for years now without the Extended Restart logic provided by IMS and we are currently involved in making changes to the programs so that the IMS XRST can be used. As I read your statement of not to consider checkpoint/restart - I am more than curious to read more on the same. Is there any link/article you can guide me with ? I am still not able to guess how can eliminating the checkpoint be a better solution when it involves having a huge amount of uncommitted data in the buffer waiting to be committed and also the parallel processes waiting for the records to be available for them. |
|
Back to top |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
PS - This topic seems to be taking a deviation from a JCL topic into a IMS topic. Moderators might consider moving this topic to the appropriate place. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
As I read your statement of not to consider checkpoint/restart - I am more than curious to read more on the same. Is there any link/article you can guide me with ? |
I'm not aware of any particular links. My suggestion comes from years of exposure to environments that have "unplugged" checkpoint/restart in applications that are undergoing major changes and not using it at all in new applications.
I have seen this done with IMS, DB2, CA-Datacom, and a few others.
Suggest that if there are multiple parallel processes updating the same rows, there will be data "adventures" with checkpoint/restart. . . |
|
Back to top |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
Hello,
There are parallel process 'accessing' the same 'databases' but not 'updating' the same 'segments'. The different processes makes use of different fields from the segment and hence the application has been running fine for now.
Anyways, thanks for your inputs on this topic, Dick. I will try to see if the ongoing XRST implementation can be replaced with a better approach.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good luck - someone will be here if there are questions
d |
|
Back to top |
|
|
|