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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1140

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: 2455
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 Cobol code- to find a string in a str... COBOL Programming 3
No new posts To pull the file with Date and Time u... TSO/ISPF 16
No new posts regarding COBOL WRITE verb (VB File H... COBOL Programming 6
No new posts COBOL Table data to a flat file with ... COBOL Programming 8
No new posts Compare 2 files replace data in 1st f... DFSORT/ICETOOL 4
Search our Forums:

Back to Top