How to get the occurence of the multi value field in natural

Hi,

Actually I need the number of occurence of the multi value field defined in the adabas file. Initially while defining the adabas file, the multi value filed is defined with the number of occurence in the predict.
Now using natural shall we get that number of occurence of the multi value field.

If anyone have idea please suggest/ If u have any sample code please.

Thanks in advance
Ramesh

DEFINE DATA LOCAL
1 MYVIEW VIEW OF EMPLOYEES
2 NAME
2 LANG (1:5)
2 CLANG
1 #LANG (A22)
1 REDEFINE #LANG
2 FILLER 21X
2 #LAST (A1)
END-DEFINE
*
READ MYVIEW
COMPRESS LANG (
) INTO #LANG
IF CLANG GT 5
MOVE '
’ TO #LAST
END-IF
DISPLAY NAME C*LANG #LANG
END-READ
END

The variable c*LANG has the actual count from the individual records.

steve

HI Steve,

Thanks.But the solution which you have given(c*) will give the number of recoeds of the multi value field populated in the adabas file. But I want the actual occurence of the multi field defined.When very first time while defing the adabas file in prdict, the multi field has number of occurence, I want that occurence number.

Thanks
Ramesh

Hi Ramesh;

Why would you want that number? It is nothing but a default for use by utilities. If you think that number is a maximum for the number of occurrences, you are wrong. It is sort of like the default lengths for field definitions. I might have CITY defined as A25. However, it might well be the case that no city has a value longer than 18, and there may indeed be values longer than 25.

To repeat, why do you want that number?

steve

The Predict definition is used by Construct and the COBOL preprocessor. If your applications are built entirely with Construct and/or COBOL, then Predict enforces the MU count - an “application maximum,” for lack of a better term.

Natural programmers can override/ignore these application maximums, but if Predict is used to set policy, then programmers ignore these values at their own risk.

As Steve stated, Adabas can provide only the actual number of occurrences of an MU. To determine an “application maximum,” Ramesh needs to retrieve it from Predict, using a combination of USR1058N and USR1051N, if I remember correctly.

I have used these API modules several times. One example was to determine whether an MU was approaching or had exceeded the application maximum. By retrieving the value from Predict rather than using a named constant, the program didn’t need recompilation every time the value changed.