AS400 Mid Range/DDS Key field

Advertisement


Question
Hi,

I have A Phisical file defined with 2 Key fields.
First Keyfield is Clientnumber, second key Field is the first 2 positions of the field name (= 30 Positions):
Example :

R KLTEST                                               
 CLNTNO           8S 0       COLHDG('No')      
 NAME            30          COLHDG('Name')             
 Field3          30          COLHDG('tst')
K CLNTNO           
K NAME             2

How can I define this?

Thanks

Answer
You cannot index on a portion of a field, only on the full field. However, you could create the index on client number and full name, then in a program, move-left the first two characters of the name to the key field, set lower-limit on the file and read the next record.

- Laird

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.