| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| HB0 Beginner
 
 
 Joined: 20 Apr 2005
 Posts: 25
 Topics: 7
 
 
 | 
			
				|  Posted: Mon May 16, 2005 7:21 am    Post subject: Dynamic Arrays |   |  
				| 
 |  
				| Hello, 
 What are Dynamic arrays and how can they be created ? In what situations do we use these ?  I didnot know which manual would help me  in the whole Cobol list ? Any help is appreciated.
 
 Thanks,
 HB0.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| HB0 Beginner
 
 
 Joined: 20 Apr 2005
 Posts: 25
 Topics: 7
 
 
 | 
			
				|  Posted: Tue May 17, 2005 2:31 am    Post subject: |   |  
				| 
 |  
				| Thanks Kolusu. 
 HB0.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| syam Beginner
 
  
 Joined: 14 May 2006
 Posts: 22
 Topics: 7
 Location: INDIA
 
 | 
			
				|  Posted: Sat Dec 30, 2006 8:58 am    Post subject: |   |  
				| 
 |  
				| My working storage declarations for the array and another group element declarations are 
  	  | Code: |  	  | 05 WS-SEL-VALUE                             PIC 9(03).
 05 WS-SEL-ARRAY.
 10 WS-SEL-REC  OCCURS 1 TO 100 TIMES DEPENDING ON
 WS-SEL-VALUE       PIC X(02).
 05 WS-DATE.
 10 WS-DD                                 PIC 9(02).
 10 FILLER                                PIC X(01) VALUE
 SPACES.
 10 WS-MM                                 PIC X(02).
 10 FILLER                                PIC X(01) VALUE
 SPACES.
 10 WS-YY                                 PIC 9(02).
 
 | 
 
 and this is my compilation output
 
  	  | Code: |  	  | 00089     05 WS-DATE.                                                   ö
 00090        10 WS-DD                                 PIC 9(02).        ö
 00091        10 FILLER                                PIC X(01) VALUE   ö
 
 1109-S A "VALUE" CLAUSE WAS SPECIFIED FOR VARIABLY LOCATED ITEM "FILLER".
 "VALUE" CLAUSE WAS DISCARDED.
 
 00092                                                     SPACES.       ö
 00093        10 WS-MM                                 PIC X(02).        ö
 00094        10 FILLER                                PIC X(01) VALUE   ö
 
 1109-S A "VALUE" CLAUSE WAS SPECIFIED FOR VARIABLY LOCATED ITEM "FILLER".
 "VALUE" CLAUSE WAS DISCARDED.
 
 | 
 if i comment the occurs clause declaration it is not throwing error. What might be the possible reason??? and what are the changes i have to make so that the program compiles without errors
 _________________
 S Y A M
 ONE CAN SMILE AND SMILE AND BE A VILLIAN
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Mervyn Moderator
 
  
 Joined: 02 Dec 2002
 Posts: 415
 Topics: 6
 Location: Hove, England
 
 | 
			
				|  Posted: Sat Dec 30, 2006 1:52 pm    Post subject: |   |  
				| 
 |  
				| The reason is described in the error message itself; you can't specify a value clause in a variably located item. 
 Remove the value clauses, and all should be well.
 _________________
 The day you stop learning the dinosaur becomes extinct
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| dbzTHEdinosauer Supermod
 
 
 Joined: 20 Oct 2006
 Posts: 1411
 Topics: 26
 Location: germany
 
 | 
			
				|  Posted: Sat Dec 30, 2006 9:21 pm    Post subject: |   |  
				| 
 |  
				| change:  	  | Code: |  	  | 10 WS-SEL-REC  OCCURS 1 TO 100 TIMES DEPENDING ON
 WS-SEL-VALUE
 
 | 
 to this:
 
  	  | Code: |  	  | 10 WS-SEL-REC  OCCURS 100 TIMES.
 
 | 
 
 and maintain a counter for the table and ws-date will be in a fixed location.
 _________________
 Dick Brenholtz
 American living in Varel, Germany
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |