MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Read array in reverse order and remove duplicates

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
koolspark
Beginner


Joined: 27 May 2010
Posts: 29
Topics: 13

PostPosted: Mon Jul 11, 2022 4:00 pm    Post subject: Read array in reverse order and remove duplicates Reply with quote

hi,

We have 300 bytes VSAM KSDS file (online file, used in CICS) with Policy number, renew count, cycle date and sequence number as part of the key.
Every time the policy premium is paid, a new record is being added to this file for the policy with the bank account details and premium paid amount.
For any given policy, the last record will always have the latest premium paid information and bank details used to pay the premium.
Now, my requirement is to get all the premium payments made with unique bank account details in reverse chronological order (most recent payment details will be shown first).
I don't have the full key information & I only know policy number (partial key), so, I tried couple of ways to achieve this and but couldn't succeed.
1) I tried STARTBR (with the policy number & by moving the high values to other key fields that are unknown) & READPREV combination, but it was failing with vsam return code 16.
2) STARTBR(with policy number, moving low values to other key fields, with GENERIC option), READNEXT to read all the premium paid records & load them into working storage array. I'm successful till this point, but getting into issues while reversing the internal array and removing the duplicate bank details. if a same bank account is used to pay the premium more than once, I need to keep only the latest bank information & premium paid amount and remove the older occurrences. Can you please help?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Mon Jul 11, 2022 11:41 pm    Post subject: Reply with quote

koolspark,

You can search the internal table before you load into it. Sample program here

http://www.mvsforums.com/helpboards/viewtopic.php?p=42173

https://www.mvsforums.com/helpboards/viewtopic.php?t=8128&highlight=search+table


https://www.mvsforums.com/helpboards/viewtopic.php?t=2476&highlight=sort+table
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
koolspark
Beginner


Joined: 27 May 2010
Posts: 29
Topics: 13

PostPosted: Thu Jul 28, 2022 11:37 am    Post subject: Reply with quote

hi Kolusu,
Thank you very much for your help. It worked Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group