PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Command to search a record

View previous topic View next topic Go down

Command to search a record

Post  Vanithadevi on Thu Oct 01, 2009 8:53 pm

Is there any CL command to search a record like CHAIN opcode in RPG?



Regards,
Vanitha.

Vanithadevi

Posts : 14
Join date : 2009-07-29
Age : 32
Location : Chennai

View user profile

Back to top Go down

Re: Command to search a record

Post  amarasuresh on Tue Dec 14, 2010 7:19 pm

If i want to search a particular record through Cl is not possible.There is No such command(like CHAIN opcode in RPG) available in CL

amarasuresh

Posts : 13
Join date : 2010-06-18

View user profile

Back to top Go down

Re: Command to search a record

Post  soundhar on Tue Jan 11, 2011 2:07 pm

WE CAN DO IT USING OVRDBF COMMAND POSITION PARAMETER

soundhar

Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai

View user profile

Back to top Go down

Command to search a record

Post  amarasuresh on Tue Jan 11, 2011 2:38 pm

through OVRDBF(over ride DB) command we can do these things
1.override (replace) the file named in the program
2.override certain parameters of a file that are used by the program
3.override the file named in the program and override certain parameters of the file being processed.

But we can't search particular record in the DB like Chain .

amarasuresh

Posts : 13
Join date : 2010-06-18

View user profile

Back to top Go down

Re: Command to search a record

Post  soundhar on Tue Jan 11, 2011 11:47 pm

No suresh...

U just try with OVRDBF-POSITION PARAMETER

It will work...

Starting position in file:
Retrieve order . . . . . . . . _______ *NONE, *START, *END, *RRN, *KEY, *KEYA, *KEYB, *KEYAE, *KEYBE
*RRN-rcd nbr *KEY-nbr key flds ________ Number
*KEY-rec format having key . . ________ Name
*KEY-key value . . . . . . . . ________


soundhar

Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai

View user profile

Back to top Go down

Re: Command to search a record

Post  soundhar on Wed Jan 12, 2011 11:35 pm

Hi suresh,
Try this CL program it will work...
**********************************************
PGM
DCLF FILE(PMS90/EMPMST)
OVRDBF FILE(EMPMST) POSITION(*KEY 1 EMPREC '00101')
RCVF
MONMSG MSGID(CPF0864)
SNDUSRMSG MSG(&EMPNAM)
DLTOVR FILE(EMPMST)
ENDPGM
**********************************************

Explaination in OVRDBF:

Retrieve order:

*START-Starting positioning of the file(BOF)
*END-End of file(eof)
*RRN-Nth record in the file
*KEY-it reads the key value which u specified in the key value(key equal)
*KEYA-it reads the key after which u specified in the key value(key after)
*KEYAE-it reads the key after equal which u specified in the key value(key after equal)
*KEYB-it reads the key before which u specified in the key value(key before)
*KEYBE-it reads the key before equal which u specified in the key value(key before equal)
*NONE-No positioning
***************************************************************
OVRDBF FILE(EMPMST) POSITION(*KEY 1 EMPREC '00101')

I am using *key to fetch record 101,it should be within quotes as '00101'...

***************************************************************



soundhar

Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai

View user profile

Back to top Go down

Re: Command to search a record

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum