How to access the "FIRST MBR" of a multi-membered file in a CL/400 program.
I have a multi-membered file called WKSLSP, which has MBRs in the following format
either MSPmmddyyn or FDBmmddyyn;(where mmddyy is the JOB-DATE and 'n' is the sequence number)
The Seq. no.(n) may range from A to Z first, and then 1 to 9. So the first member on any given day will look like FDB091510A and the second one will look like FDB091510B & so on, till FDB091510Z
and FDB0915101, FDB0915102,.. till FDB0915109 in that sequence only.
The program will be called with a parameter (either 'FDB' or 'MSP')
I need to pick-up the FIRST MBR of either 'FDB' or 'MSP', based on the above parameter passed, in the above mentioned sequence.
This seq. no. is required, as they may send us more than 1 file per day on any given day
& and both 'MSP' & 'FDB' can come on the same day as well.
In the above mentioned example...
If I call the program with parm 'FDB', it should pickup "FDB100510A" as the first MBR.
If there are no "FDB100510A" or "FDB100510B", then "FDB1005106" should be picked up.
Same is the case with 'MSP' also(i.e. "MSP1005103" should be picked up as the first MBR)
Any help would be greatly appreciated.
Thanks in Advance,