View previous topic :: View next topic
|
Author |
Message |
elango
New User
Joined: 27 Apr 2005 Posts: 12 Location: chennai
|
|
|
|
we want the coding for this search logic.
records from the table can be fetched by using pf7 key for backward search and pf8 key for forward search from any given record number.
can any one help us as much as possible..
regards
elango :lol:
<<<Mail- ID Removed>>> READ FORUM RULES. |
|
Back to top |
|
|
squid_rocks
New User
Joined: 21 Mar 2005 Posts: 15 Location: Pune, INDIA
|
|
|
|
Hi,
Can you specify more details like where are you searching from, etc.
I guess what you are trying to devlope is a browsing program, or something like it.
Well, for using PF7 and PF8 keys, what you need to do is, use DFHPF7 and DHFPF8.
These are the DFHxxx values, if the use had pressed PF7, then DFHPF7 will be true and so on. So you need to use Evaluate of If statement to find out whether PF7 or PF8 has been pressed.
Then, if these keys are pressed, you will need to code logic like search (more details needed here).
If the file is a small one, then you may want to maintain a copy of the file in TSQ. That way, we can access them using ITEM option with READQ TS.
Or if you are using a DB then we need to code the logic that way.
Hope it helps.
Please post more details so we can help you further. |
|
Back to top |
|
|
elango
New User
Joined: 27 Apr 2005 Posts: 12 Location: chennai
|
|
|
|
Dear squid_rocks,
Thanks for Ur replay.Iam explaing my task clearly....
For example a db2 table consists of employee information?s about 100 records. I want to search the information in this way...
I will give a particular employee number and press pf8 key. Then it should display five records after that record, for example if i enter employee id 51 means it should display all the information in the map from employee id's 51 to 55.Like that if i press pf7 means it should traverse back and display records from 47 to 51 and so on.
For that I want do design a CICS map in a way that it should hold five rows of information at a time. Here is my another problem that how can we use occur class in designing maps? I don?t know the above logics.
I need some sample coding for this search logic and also coding for declaration of a CICS map with occurs clause.
Plz help me
Regards
Elango
elango_rs@rediffmail.com |
|
Back to top |
|
|
ankyhunk
Moderator
Joined: 05 May 2005 Posts: 98 Location: Navi Mumbai, India
|
|
|
|
Regarding designing your Map - You can display a group variable(01 level) & put the fields in it. e.g.
01 Employee Occurs 5 times.
05 Name
05 Salary etc
Regarding display - Whenever the user put the key values and presses enter the program shoots the query & the o/p is written to a VSAM file. Then whenever user presses PF keys for display you can show the records using STARTBR, READPREV & READNEXT.
For details refer to CICS manuals. |
|
Back to top |
|
|
ankyhunk
Moderator
Joined: 05 May 2005 Posts: 98 Location: Navi Mumbai, India
|
|
|
|
Whenever we have to display records either in forward or backward direction from a database, there are 2 options -
1) Shoot the query everytime user presses PF key
2) Shoot the query once & write the output to a KSDS file and read it on every key press accordingly.
Correct me if I am wrong. |
|
Back to top |
|
|
sundaresanjs
New User
Joined: 29 May 2006 Posts: 18 Location: USA
|
|
|
|
but sir,
This is Sundaresan, i have used the options which u have given, but it doesn't work properly,
i am reading a ksds file for the browse and first reading the first 10 records in it, and now if i press f8 it should display the next 10 records instead it goes to exit
how can i rectify it
Regards, |
|
Back to top |
|
|
joshua1983
New User
Joined: 25 May 2006 Posts: 7 Location: Mumbai, India
|
|
|
|
hi elango
while desigining the map, u have create an array of variables of required size which I assume tat u know it.....
now for displaying records 51 to 55...(in case u input 51 and press enter)
then
Evaluate EIBAID
when enter key
TSQ-ITEM = 51
PERFORM SCROLL-FORWARD-PARA
END-EVALUATE
SCROLL-FORWARD-PARA.
EXEC READQ
ADD 1 TO TSQ-ITEM
if u have not got the above clearly then do ask me specifically where u didnt get.... |
|
Back to top |
|
|
sundaresanjs
New User
Joined: 29 May 2006 Posts: 18 Location: USA
|
|
|
|
hai,
i have posted a logic for the need u asked, in the name ' Logic for scroll up and scroll up', u can verify it,
correct me if any errors,
regards,[/list] |
|
Back to top |
|
|
|