View previous topic :: View next topic
|
Author |
Message |
PPRASAD2
New User
Joined: 06 Aug 2009 Posts: 21 Location: chennai
|
|
|
|
Hi All,
I have successfully coded my program for the first time.
Thanks alot to you all for your help.
Now one more qlarification that I need from you.
01 REPORT-ARRAY-F01140.
05 FILING-DETAILS-TABLE-F01140 OCCURS 50 TIMES
I have coded my array like this, but when I tried to move data from array to output file, all the other occurrences are coming as spaces, because my input file has only 20 records but occurs 50 times.
How to avoid those spaces. I heard this can be done by dynamic array.
What is that and how it can be?
Could you please guide me.
Thanks
Prasad |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Prasad...
Kudos on getting your first code working...
Quote: |
How to avoid those spaces. I heard this can be done by dynamic array.
What is that and how it can be? |
well .. i will also ask the same question... what do u mean by "avoid spaces"... how can we "avoid" spaces.... |
|
Back to top |
|
|
PPRASAD2
New User
Joined: 06 Aug 2009 Posts: 21 Location: chennai
|
|
|
|
I mean after writing my 10 input records, it takes spaces for other occurrences because there is no data from 11th occurence.
I meant this |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Prasad,
You have already told that you are getting spaces... agreed ... I do not have any issues in that..
What is it that you are expecting... Are u expecting something else other than spaces. |
|
Back to top |
|
|
PPRASAD2
New User
Joined: 06 Aug 2009 Posts: 21 Location: chennai
|
|
|
|
No Binop.
After I have coded 4 arrays and stored same type of data in those arrays and need to write them all to an output file one by one.
first array is writing 10 records after that 40 empty lines are coming
after that next array is getting dispalyed..like that it's happening
Report should be line after line right.
Hope you got it |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as someone said earlier, as you load the table, keep a counter of occurances used, then you don't have the problem during output.
by dynamic you mean ODO - occurs depending on - learn the proper terminology.
either check your item for spaces before outputing or do it the easy way and maintain a counter of items in the array and use the counter to control a perform loop. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Prasad,
By the looks of it, I guess your problem is related to your coding logic.
I would suggest you spend some more time reviewing your code and then probably you could post us with your findings. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Have you read up on the OCCURS DEPENDING ON clause? Are you keeping track of the number of occurrences you are loading into the table so that when you unload it, you know when you've exceeded the actual number of occurrences you've loaded? If you've loaded 20 of your 50 occurrences, you should not be referencing occurrences 21 through 50 in your logic. Oops, I failed to read page 2 of the posts before responding. |
|
Back to top |
|
|
sijayapal
New User
Joined: 23 Dec 2008 Posts: 69 Location: India
|
|
|
|
Is it possible to pass an array from one prog to another via linkage section? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Sure, that's not a problem.
If you're on VS/COBOL II and greater, check out EXTERNAL DATA, which is available to ALL programs within the run-unit, without having to "pass" them (actually under the covers, it's the address), in a CALL statement.
Bill |
|
Back to top |
|
|
|