one physical file have 6 key fields,now i want to retrive the 10th record
based on one key field,how to retrive in cobol/400 with without using logical file
ex:- emp pf have 6 key fields,and emp have records,now i want to retrive particular record in emp(10 th record only),in my cobol pgm some times use 6 key fields and some time i want use only one key field with out using logical files
pls give replay with small example
Software/Hardware used:
software
ASKED:
October 5, 2011 10:07 AM
UPDATED:
March 31, 2012 12:36 AM
If you only want to use a physical file (a ‘table’) and you program cannot know ahead of time which fields will be used as selection (key) fields out of six possible ones, there are three general possibilities.
In each case, count the records until you reach 10. (With SQL you might use relative positioning.)
I suppose it’s also possible to use the C library functions such as _Rlocate() — Position a Record to retrieve specific records, but it’s not clear how you would use those when no appropriate access path existed (without creating one which seems to violate a “no LFs” rule.)
Tom