Page 1 of 2

Query on insertion of records in in a DBD

PostPosted: Tue Nov 18, 2008 8:11 pm
by er.manishawasthi
THE db sTRUCTURE TXT FILE IS ATTACHED

I NEED TO INSERT A CALL FOR THE INSERTION OF ARRIVAL AND DEPARTS OF FLIGHT UNDER CORRESPONDING AIRLINE AND AIRPORT
WHAT CAN BE PSEUDOCODE FOR IT.
WHAT ALL THINGS IN NEED TO KEEP IN MIND WHILE INSERTING THE RECORD IN ARRIVAL AND DEPARTS.............

Re: Query on insertion of records in in a DBD

PostPosted: Tue Nov 18, 2008 9:18 pm
by Sandy Zimmer
Is this an existing program? How will you determine which airline and aiport gets these new segments? If this is an existing program, what is it's function now?

Re: Query on insertion of records in in a DBD

PostPosted: Wed Nov 19, 2008 5:34 am
by Sandy Zimmer
Since you have not yet replied, I have a few more questions. Is this program DLI, BMP or MPP? What is your input - how do you determine where the arrival and departs go? Is this view of the database BOTH the physical and logical view?

Re: Query on insertion of records in in a DBD

PostPosted: Wed Nov 19, 2008 9:42 am
by er.manishawasthi
ur 1st question s this an existing program?
.........The program for insertion of records in airline and airport has been coded .Now, i need to code to insert Deaparts and arrivals under existing databse record of Airport and Airline..........

How will you determine which airline and aiport gets these new segments?

Airport has a key field which is unique.... Called AIRPORT-CODE and Similary Airline has a unique key field...AIRLINE-CODE .

If this is an existing program, what is it's function now?
Function is to insert Departs and Arrivals under corresponding Airport and Airline.

Is this program DLI, BMP or MPP?
BMP...... Offline.........
What is your input - how do you determine where the arrival and departs go?
By using the qualified ssa for Airline and airport

Is this view of the database BOTH the physical and logical view?

Yes...........

Re: Query on insertion of records in in a DBD

PostPosted: Wed Nov 19, 2008 5:12 pm
by Sandy Zimmer
You are running BMP which means that the database is up and available online while you batch BMP is running. You must have an input file. What is the record description of the input file?

Re: Query on insertion of records in in a DBD

PostPosted: Thu Nov 20, 2008 4:04 pm
by er.manishawasthi
the record description of inpt file.................

1.Airport
2. Airline
3. Arrival
3. Departs
1.Airport
2. Airline
3. Arrival
3. Departs
1.Airport
2. Airline
3. Arrival
3. Departs

Re: Query on insertion of records in in a DBD

PostPosted: Fri Nov 21, 2008 7:22 pm
by er.manishawasthi
i'm attaching the input file an the code in next alsoCheck it if it is correct or not

Re: Query on insertion of records in in a DBD

PostPosted: Fri Nov 21, 2008 7:45 pm
by Sandy Zimmer
I am looking at your code - pretty good! There are a couple of questions tho. Where is w-count1 and what does it have to do with the type of record you have? What determines whether you are inserting an arrival or depart segment? Are you assuming that you will have a record for each airport/airline? Are you making sure that your input file is PRE-SORTED in airport-airline-arrival-depart sequence?

Re: Query on insertion of records in in a DBD

PostPosted: Fri Nov 21, 2008 9:05 pm
by Sandy Zimmer
Also, please consider an error report on why your insert failed. You need to look at the seg-level when retrieving the airport and airline. If you get a "GE" - which one was it? If seg-level is 1 than it was the airport - if 2 then it was the airline. Also, you need to report on "II" on your insert. You need to define ws-rec.

Re: Query on insertion of records in in a DBD

PostPosted: Sat Nov 22, 2008 4:12 pm
by er.manishawasthi
answer to ur questions.............

Where is w-count1 ???

Actually there is no w-count1, I mispelled it, It's w-count... I have also define W-COUNT in my working storage section.................

ThaNK YOU VERY MUCH FOR LETTING ME KNOW MY MISTAKE..........

what does it have to do with the type of record you have?

THE fILE FROM WHICH I'M READING IS A SEQUENTIAL FILE....So i'm using a counter to read four lines from a file ....and performing four diffrent functions......

I have used

PERFORM 3100-READ-INPUT
THRU 3100-EXIT
VARYING W-COUNT FROM 1 BY 1
UNTIL (W-COUNT > 4 OR END-INPUT-FILE = 'Y')


so that i limit fifth line............... Then after fouth functions i'm performing a intialisations para so In which i have Move 1 to a counter and again it performs four diffrent functions........


What determines whether you are inserting an arrival or depart segment? Are you assuming that you will have a record for each airport/airline? Are you making sure that your input file is PRE-SORTED in airport-airline-arrival-depart sequence?

Right now i have been given a dummy project. So i'm assuning the records are sorted and the input file is reviewed and passed by my senior........ So my input file is presorted airport-airline-arrival-depart sequence

Also, please consider an error report on why your insert failed.

Please elaborate what you want to say.... i couldn't get what you wanted me to do . I'm new to IMS DB.. and this is my first code.....

You need to look at the seg-level when retrieving the airport and airline. If you get a "GE" - which one was it?

Even i have this questiopn in my mind but don't know what to do ..If GE occurs how can i know which segement is not fount ..( AIRPORT or AIRLINE). I might need to discuss with my senior on monday..

Also, you need to report on "II" on your insert

IF STATUS-CODE = 'II'
DISPLAY 'DUPLICATE INSERT'

I'm displaying duplicate insert when Status - code is II but don't know what do you mean by ''you need to report on ''

You need to define ws-rec.
Actually the field decription of my Airport , Airline , Arrival Segment and depart is diffrent so i'm using ws-rec as maximum.

I'm attaching a txt file giveing description of fields of each and every segment so that u can understand My pupose of using it ..if you still have questions reagarding this let me know...

And on Monday My senior will be checking my code . so please, let me know iof ther is any mistake in it........