Joined: 24 Dec 2002 Posts: 32 Topics: 6 Location: U.K
Posted: Wed Apr 21, 2004 9:29 am Post subject: Reading a GDG in FIFO order ?
Hi
I have a strange requirement here. I have a cobol program that needs to read in all the members of a GDG.
Initially i went about by giving the GDG base as the ddname in the proc, it concatenates the GDG members but then the default order is LIFO. But given the processing logic of my cobol program i want this concatenation to happen in FIFO order.
Now i read an earlier post about reading GDG's in reverse order. They suggested 2 approaches. Approach 1 was to run a ReXX code, which is fine but then i wont be allowed to run ReXX codes on my mainframe installation (dont ask why ?). Approach 2 was to use sort and assign sequence no's and then sort in the descending order and finally removing the sequence no's. Now even this has a glitch. Let me just give an overview of how the data in the GDG member looks like. It basically consists of a header followed by detail records and then the trailer record. Now if i go by the sort approach, i get the data in FIFO order but it comes in a trailer record followed by detail records and then the header record which is not acceptable. Hope iam clear here ?
Now all i wanna know is if there is any other approach (plz try and confine to cobol and jcl) to do this ?
With regards
Naren _________________ "Hold fast to dreams, for if dreams die, life is a broken winged bird that cannot fly."
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