Page 1 of 1

To display value of periodic group field

PostPosted: Fri Oct 08, 2010 3:38 pm
by diptisaini
Hi,


PE * NEW-ASSET-ATTRIBUTE-GROUP ......
* NEW-ASSET-ID ................... (A12) D
* NEW-ASSET-DESC ................. (A30)
* NEW-ASSET-CURR-CODE ............ (A3)
* NEW-ASSET-NOM-VAL .............. (N11.3)
* NEW-ASSET-LOT-SIZE ............. (N7)
My requirement is that i want to display value of NEW-ASSET-ID but i don't know on which occurence value is populated.
Can you please provide me any example ?

Re: To display value of periodic group field

PostPosted: Fri Oct 08, 2010 10:50 pm
by RGZbrog
Although Adabas allows up to 191 occurrences of a PE, your file and application designs should define the logical maximum, and that maximum should be used in your view. Ask Adabas to return the number of occurrences actually used in each record - by using C* notation.
1 #MAX (I4)  CONST <25>
...
1 file   VIEW file-name
  2 C*NEW-ASSET-ATTRIBUTE-GROUP     /* number of occurrences actually used
  2 NEW-ASSET-ID (#MAX)             /* retrieve a maximum number of occurrences

Then code one of the following.
ASSIGN #I = C*NEW-ASSET-ATTRIBUTE-GROUP
DISPLAY NEW-ASSET-ID (1:#I)

FOR #I = 1 C*NEW-ASSET-ATTRIBUTE-GROUP
  DISPLAY NEW-ASSET-ID (#I)

Re: To display value of periodic group field

PostPosted: Tue Oct 12, 2010 2:15 pm
by diptisaini
Thanks