How to initialize a group data which is containing occur clause?

Showing Answers 1 - 7 of 7 Answers

Venkata999

  • Mar 19th, 2006
 

Hi Friend,

#.1 . Here is an example for how to initialize the  normal  group variable   .

ex :   01  ws-details .

             02  ws-name    a(10 )  .

             02  ws-desig      a(5)    .

move  spaces   to  ws-details   .

#.2  . If occurs clase exist , here is the example 

move  all spaces  to  ws-details  .

The only diff is we need put the "  all "   .  Same can be done using perform  and repeting loop   equal no of occur times .

Hope this will  help  ....

  Was this answer useful?  Yes

gomathy

  • Mar 27th, 2006
 

Hi,

VS COBOL II supports group initialization of occurs clause as well.

E.G. 01 WS-TEST.

               05 WS-TEST1 OCCURS 100 TIMES.

               05 WS-TEST2 OCCURS 200 TIMES.

INITIALIZE WS-TEST will work.

Thanks.

  Was this answer useful?  Yes

Siva

  • Apr 21st, 2006
 

Hi, Group data that contains OCCURS Clause can be initialized/set to a default value using VALUE clause as mentioned below.01 ARRAY3 VALUE '0102030405'. 02 TABLEDUMMY3 OCCURS 5 TIMES. 05 SNO3 PIC 99.

  Was this answer useful?  Yes

ajay

  • Apr 27th, 2006
 

Hi,

let us take and example:

01 ws-array value 'abcdefghijklmnop'

    02 ws-a1 pic x(1) occurs 17 times.

if u initialize ws-array then by default

ws-a1(1) will contain 'a' value

ws-a1(2) will contain 'b' value

ws-a1(2) will contain 'c' value....

please let me know if u have any concerns..!!

Thanks

ajay

 

  Was this answer useful?  Yes

ATUL BANKE

  • Jun 9th, 2006
 

Here is the example:

01 WS-REC.

    02 TAB OCCURS 10 TIMES.

         05 EM-NAME PIC X(5).

         05 EM-PHONE PIC 9(10).

  Was this answer useful?  Yes

sanjeev_16

  • Aug 25th, 2009
 

01 SALES-TABLE. 
02 SALES-DETAIL OCCURS 100 TIMES.
COPY DDS-ALL-FORMAT OF EMPPF.
If a group data is using database reference, where emppf is logical file name.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions