×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 29-Feb-2012 14:23 , James Lampert wrote:
I need to set up a logical file that is uniquely keyed on one of the
PF fields, but which omits all records in which that field is either
blank, or starts with an asterisk.
But I find that if I explicitly define a field substringing that
field (to check for the asterisk), I lose all the PF fields.
The LF DDS either defines the same format as the PF [i.e. no field
specifications allowed], or defines explicitly the fields of the record
format. Because a SST requires specifying a field, all of the fields
for the LF record format must be named as an equivalent from the PF or
[re]defined from field(s) in the referenced PFILE(s).
If there's a way to do this without explicitly including all of the
PF fields, I don't remember what it is.
Do not use the SST to define a new derived field against which to
effect the select\omit COMParisons.
Help?
For example:
The DDS source for a PF [for this example, named FN] with 6-byte
Alpha field C for RcdFmt FNR:
R FNR
C 6A
The DDS source for a unique keyed LF on field C of PF FN in *LIBL
defined to effectively select only rows where (C *NE '') *AND (SST(C 1
1) *NE '*') while still sharing the based-on physical file Record Format
FNR instead of having to define a new LF record format per having used
the SST; defined [at least with SRTSEQ(*HEX)] and using Omit logic
specifications to effect the exclusion of any rows from the unique key
where effectively (C *EQ '') *OR (C *GT x'5B' *AND C *LT x'5D') /* where
x'5C' defines the '*' asterisk, being the first byte of field C */:
UNIQUE
R FNR PFILE(FN)
K C
O C COMP(EQ ' ')
O C COMP(GE X'5C0000000000')
C COMP(LE X'5CFFFFFFFFFF')
The unique keyed access path for the above LF DDS enables the PF to
have any number of duplicate values for C=' ' and for any value of C
where LEFT(C,1)='*', but any other values must be distinct\unique. As a
DYNSLT LF, no duplicate values would be allowed irrespective of the
first character, but any one row with C=' ' and all distinct rows with
LEFT(C,1)='*' would be omitted.
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.