View previous topic :: View next topic
|
Author |
Message |
PPRASAD2
New User
Joined: 06 Aug 2009 Posts: 21 Location: chennai
|
|
|
|
Yes Terry and Dick, I saw it's working
Thank you |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
PPRASAD2
New User
Joined: 06 Aug 2009 Posts: 21 Location: chennai
|
|
|
|
hey
Is any thing wrong in my code?
FD REPORT-FILE
RECORD CONTAINS 149 CHARACTERS
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD
DATA RECORDS ARE REPORT-RECORD.
01 REPORT-RECORD.
05 MOBIUS-DETAIL-LINE.
.
.
.
.
SET AI TO 1.
PERFORM 0180-PRINT-HEADING.
PERFORM 0170-READ-ARRAY VARYING AI FROM 1 BY 1 UNTIL
AI > 1000.
.
.
.
.
0170-READ-ARRAY.
MOVE FILING-DETAILS-TABLE(AI) TO REPORT-RECORD.
MOVE REPORT-DETAIL-LINE-CC(AI) TO MOBIUS-DETAIL-LINE.
MOVE REPORT-DETAIL-SYMBOL(AI) TO MOBIUS-DETAIL-SYMBOL.
MOVE REPORT-DETAIL-NUMBER(AI) TO MOBIUS-DETAIL-NUMBER.
WRITE REPORT-RECORD.
when I display array contents , it is displaying properly but in out put records are not coming |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
You need to show us the definition of your COBOL table and tell us whether or not you are checking the file status of all file I-O including the WRITE statement and what you mean by
Quote: |
in out put records are not coming |
|
|
Back to top |
|
|
sasikumar1984
Active User
Joined: 02 Jul 2007 Posts: 109 Location: Chennai - India
|
|
|
|
Prasad,
I doubt with your array declaration for the above problem. Can you post the array declaration here...?
Also your performing the loop until AI reaches 1001 (atleast 1000 times). since your loading the array using your input file, load the array until end of file and keep increament some counter(declare some counter variable) for each read of your i/p file, then at end of last recod your counter will be having total number of record that your i/p file have. Then you can perform the array as below
PERFORM 0170-READ-ARRAY VARYING AI FROM 1 BY 1 UNTIL
AI > 1000 or AI > your-counter-variable
or
PERFORM 0170-READ-ARRAY VARYING AI FROM 1 BY 1 UNTIL
AI > your-counter-variable |
|
Back to top |
|
|
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: 1249 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 |
|
|
|