GeekInterview.com
Series: Subject: Topic:
Question: 148 of 233

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

Asked by: Interview Candidate | Asked on: Feb 25th, 2006
Showing Answers 1 - 7 of 7 Answers
ralph

Answered On : Feb 27th, 2006

View all answers by ralph

Initialize Group-item

  
Login to rate this answer.
Venkata999

Answered On : Mar 19th, 2006

View all answers by Venkata999

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  ....

  
Login to rate this answer.
gomathy

Answered On : 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.

  
Login to rate this answer.
Siva

Answered On : 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.

  
Login to rate this answer.
ajay

Answered On : 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' valuews-a1(2) will contain 'b' valuews-a1(2) will contain 'c' value....please let me know if u have any concerns..!!Thanksajay 

  
Login to rate this answer.
ATUL BANKE

Answered On : 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).

  
Login to rate this answer.
sanjeev_16

Answered On : Aug 25th, 2009

View all answers by sanjeev_16

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.