From the course: COBOL Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Solution for creating an indexed file - COBOL Tutorial
From the course: COBOL Essential Training
Solution: Solution for creating an indexed file
(upbeat music) - [Instructor] How did you make out what the challenge? I'd like to show you how I approach this problem. Here, I just have a copy of the baseball file that's coming into the program. As you can see the, game ID, which is the first 36 characters is unique for each game. Let me switch over to the create index file. In this program, I need to bring in that line sequential file and write out a new indexed file. So starting with the environment division, on line eight, we see where I'm reading in the line sequential file that we just looked at. Scroll down a little bit. Line 11 is where I define the baseball index file. And notice on line 13, it says organization is indexed. Line 14 says access mode is random. Line 15 is where I define my record key. As I stated, I made sure that the game ID did not have any duplicates. I removed all the duplicates. So I can make the record key the game ID key, which I…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.