IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL Student learning COBOL File Handling - Help Needed !!


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
torrind

New User


Joined: 09 May 2020
Posts: 2
Location: UK

PostPosted: Sat May 09, 2020 3:40 am
Reply with quote

Hi All,

My first time here! icon_smile.gif

I'm a student seconded to a Large bank in the UK as part of my course and I'm learning COBOL in my spare time (GNU COBOL). As a project, I'm writing a simple airline booking program and have got quite far. The help I need is as follows:

If I have a 100 seater aeroplane setup as 4 rows of 25 seats, I want to be able to read the seat numbers in from a file and display where they are booked on this 4 x 25 grid as follows:

row1: xxxxxxxxx*xxxxx*xxxxxxx*x
row2: xxxxxxxxxxxxxxxxxxxxxxxxx
row3: xxxxxxxxxxxxxxxx**xxxxxxx
row4: xxxxxxxxxx*xxxxxxxxxxxxx*

In this example row 1 shows seats 10, 16 and 24 as booked
row 3 - seats 67 & 68 are booked
row 4 - seats 86 & 100 are booked (x's are empty seats)

Can anyone help with a simple way of doing this? I've been at this for weeks with no real success.

Thanks in advance,

Darren
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 934
Location: Maryland

PostPosted: Sat May 09, 2020 8:47 am
Reply with quote

www.ibmmainframeforum.com/
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Sat May 09, 2020 2:12 pm
Reply with quote

Funny sort of airplane! Do you mean 25 rows of 4 seats per row?


In any event, SergeyKen is correct - you are not an expert so really should be in the Beginners Forum.
Back to top
View user's profile Send private message
torrind

New User


Joined: 09 May 2020
Posts: 2
Location: UK

PostPosted: Sun May 10, 2020 12:14 am
Reply with quote

Hi All,

Apologies for posting this in the wrong forum - I'm new to all this and didn't realise.

Thanks for the feedback guys.

Darren
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare the file record count percent... DFSORT/ICETOOL 2
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
Search our Forums:

Back to Top