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

Program to pass value on screen from VSAM FILE


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanjana

New User


Joined: 20 Apr 2006
Posts: 2

PostPosted: Tue Jun 09, 2009 10:16 pm
Reply with quote

i am working on a cics program.The functionality is, it will take all the information of the flights going from Mumbai to delhi and display on the screen where all the flight details will got to the protected filelds on the screen.
I myself need to decide the layout of the VSAm file and the fields which are there on the screen are; Airline, departure, arrival, stops, duration and price, The source to destination information as << flights from MUMBAI to DELHI>> is showing up properly on the current screen and these are the values entered by the user in the previous screen,
The fields declared as
001600 01 WS-COMMAREA.
001700 05 WS-EXEC-CTR PIC 9(2).
001710 05 WS-DEPARTURE-FROM PIC X(10).
001720 05 WS-DEPARTURE-DATE PIC X(10).
001730 05 WS-ARRIVAL-TO PIC X(10).
001740 05 WS-RETURN-DATE PIC X(10).
001741 05 WS-ADULTS PIC 9(01).
001742 05 WS-INFANTS PIC 9(01).
001743 05 WS-CHILDREN PIC 9(01).
001744 05 WS-FS-CTR PIC 9 VALUE 0.

please help me with the layout of the VSAm file and how can i display the information of Airline, departure, arrival, stops, duration and price for all teh flights from mumbai to delhi
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 10, 2009 7:00 am
Reply with quote

Hello and welcome to the forum,

You need to much more completely define the requirement.

Where is the information currently used stored? Is this new info to be added to that info (in some new file, or . . .)? How is the price for every flight obtained?

Is there some reason not to use the current screen (or a modified version of it)?

That is only a "quick list" - i suspect there is much more that needs to be resolved.
Back to top
View user's profile Send private message
sanjana

New User


Joined: 20 Apr 2006
Posts: 2

PostPosted: Thu Jun 11, 2009 1:21 am
Reply with quote

Hi,
Thanks for your quick response. Here is the scenario:
Screen 1: This screen has two options:
Option 1: One way Travel, Option 2: two way travel
if user selects option 1 then only souce and destination fields on the screen take sthe value along with the departure date and the return date with automatically get protected.
In this scenario there is no need to access any file or to get data from any file.
The values ( Souce name ex Mumbai, Destination Name ex Delhi, departure Date) will be passed via COMMAREA to the next program.

Screen2: Have the heading, Flights from <Souce name from the previous screen/program> to <Destination name from the previous screen/program> on <Date from the previous prog>

Now this is the screen where i need to use the VSAM file which already have values as i meantioned in my last post as "Airline Name, departure Time, arrival time, stops, duration and price". There is no hard and fast rule on this data as i need to prapare a VSAM file with the values for each and every field.
My questions is;
1) What will be the flight layout as primary key, I am thinking of taking a primary key as FLIGHT_NO <Will be adding an extra field in the file and fetch the reocords accordingly and not showing up any where> but how can I code the logic in the program to show the details of only those flight on the screen which are requested by the user in the previous screen with all the fields.

Departure flight from <Souce> to <Destination>

Sel Airline Departure Arrival Stops Duration Price
_ ______ _____ _____ _ ______ _____
_ ______ ______ _____ _ _____ _____
_ _____ ______ _____ _ ____ ______

I need fetch the data from the VSAM file and reflect those on the screen under the resoective enteries in the protected filelds as above.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 11, 2009 3:20 am
Reply with quote

Admit it -- you're a student and this is an assignment, right?

First, find a board. If you can't find a board, tape a large piece of blank paper to a wall. On one side of the board / paper, design the system and on the other side do the data design. From the initial transaction keyed in, what do you want displayed on the screen? Do some of those values come from a file? Do some of those values go to a file? What should the next screen displayed have on it? What data needs to be passed from program to program? Doing a good system design and data design will save you many, many, many hours of coding and testing and recoding.

Things to consider while designing:
1. using the IATA 3-character airport codes would save keying and reduce typos; finding a city name from the airport code would be a simple table lookup
2. flight number is a really lousy choice for a key -- for two reasons: (a) how many carriers have a flight 1234 and how few of them have this flight going from one specific location to another, and (b) flights are not unique -- if you buy a ticket from Delhi to Pune on flight 1234, that's probably going to be associated with a date (say 6/15) -- and you most likely cannot use that ticket on 6/13 without penalty
3. what about plane capacity -- if your plane holds 73 people and you sell 225 tickets from Mumbai to Delhi, there's going to be lots of unhappy customers, not to mention possible governmental action
4. your COMMAREA is limiting adults, infants, children to 9 or less; probably not the best idea if families decide to travel together and they have lots of kids
5. is this an airline with only one class of seat? If not, you need to be able to distinguish between coach, business, first class seats and tickets
6. you list stops on your last post -- do you want to just have the count, or the specific names? In either case, your flight file better have a way to link the different segments together because two people might want to start at the same stop but go to different locations -- data design for sure!

I'm sure you will consider other things as you design -- frequent flyers, pricing different segments of a flight that has 3 stops, assigned seats versus open seating, window versus aisle seats, data validation (return dates before departure dates for one), and so forth.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 11, 2009 3:48 am
Reply with quote

Nice post Robert.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 11, 2009 4:19 am
Reply with quote

Thanks Dick. Design is so crucial and so often an afterthought, especially with students who are too eager to get coding to realize what they DON'T know.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Jun 11, 2009 7:03 am
Reply with quote

isn't their a forum out there for beginners ?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 11, 2009 7:42 am
Reply with quote

Hello,

Yup. . .

ibmmainframeforum.com

which is:
"A Help & Support Forum for Mainframe Beginners and Students"
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top