1,025 pts.
 AS400
DB2
In DDS, Unique is file level keyword. Is there any specific key word for field level?

Software/Hardware used:
ASKED: December 29, 2008  7:11 AM
UPDATED: December 30, 2008  11:44 AM

Answer Wiki:
Hi, Yes, there are plenty of field level keywords - for example :- COLHDG TEXT EDTCDE EDTWRD REFFLD VALUES Regards, Martin Gilbert.
Last Wiki Answer Submitted:  December 29, 2008  11:59 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

A UNIQUE
A R REC1 PFILE(FILE1)
A K Num
A K Age

In the Above code, Num and Age Combination is unique. Like
Num Age
1 1
1 2
2 1
2 2
But i want to be like

Num Age
1 1
2 2

Here num is unique and Age is Unique. Combinations is also unique
Is there ant specific keyword for this condition

 1,025 pts.

 

Hi,

There’s no specific keyword for this condition. One solution would be to build 2 logical files – the first logical with only NUM as key and UNIQUE specified and the second logical with only AGE as key and UNIQUE specified :-

LF1 :-

A UNIQUE
A R RECL1 PFILE(FILE1)
A K Num

LF2 :-

A UNIQUE
A R RECL2 PFILE(FILE1)
A K Age

You’ll have to make sure that your applications handle errors caused by trying to add duplicate keys to these logicals.

Regards,

Martin Gilbert.

 23,625 pts.