View previous topic :: View next topic
|
Author |
Message |
jwell rymbei
New User
Joined: 14 Dec 2005 Posts: 22 Location: India
|
|
|
|
Hi,
Is there any way to display a counter in the spool area. I want to display how many records my cobol program has processed. The counter should keep on increasing but it sould not be displayed in the next line in spool area. In a loop if we use display we can see the output in the spool area but in multiple lines. |
|
Back to top |
|
|
nuthan
Active User
Joined: 26 Sep 2005 Posts: 146 Location: Bangalore
|
|
|
|
Hi,
I didnt got ur question . U can use the display of counter outside the loop. so that u can get the total no of records processed. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Is there any way to display a counter in the spool area. |
Yes, use simple DISPLAY statement.
Quote: |
I want to display how many records my cobol program has processed. The counter should keep on increasing but it sould not be displayed in the next line in spool area. In a loop if we use display we can see the output in the spool area but in multiple lines. |
I interpreted this text as, you want to print INPUT Counter at the end of the program, not every time counter get incremented.
So for this dont put DISPLAY statement inside the READ PARA.
DISPLAY ther final recoerd counter at the end of the program.
Regards,
Priyesh. |
|
Back to top |
|
|
jsk
New User
Joined: 20 Feb 2006 Posts: 12
|
|
|
|
Hi,
You can use Display " ws-counter".
Ws-counter should be defined in the working storage section as pic 9(xx)
xx depends on your choise( no: of records in the file)
As what nuthan suggests if you use the counter outside the loop (where you read ) the final value accumulated will alone be displayed in the spool area.
Quote: |
The counter should keep on increasing but it sould not be displayed in the next line in spool area
|
can you make clear what you meant by next line in spool area.
Corrections Welcomed |
|
Back to top |
|
|
jwell rymbei
New User
Joined: 14 Dec 2005 Posts: 22 Location: India
|
|
|
|
Evrytime counter is incremented i want to display it but the in sysout there should not be multiple lines. Lets my pgm reads a file and based on some condtions it creates report. Say input file contains 100 records. out of it only 10 records matches the conditon. Now if i want to display a counter which should get incremented each time the pgm processes new records. Say pgm has processed 5 th record then sysout should look like
counter=5 not like below
counter=1
counter=2
counter=3
counter=4
counter=5
[/right] |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Evrytime counter is incremented i want to display it but the in sysout there should not be multiple lines. |
How can it be possible... you want to display the counter every time it gets incremented and on the other hand you dont want to see multiple Lines..... You'll have to give up either one.....
I hope as per your need you should not DISPLAY counter after every READ INPUT.... Get it DISPLAYed at the end of the file.
Regards,
Priyesh. |
|
Back to top |
|
|
tksvv
New User
Joined: 17 Mar 2006 Posts: 6
|
|
|
|
I think what the O/P wants is a display similar to the clock or odometer. The digits are replaced instead of displayed one below the other in a clock or odometer.
That is not possible in the spool as the spool is written sequentially. |
|
Back to top |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
You can diaplay counter value after close file .then u will get processed record count |
|
Back to top |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
Please check ur PM |
|
Back to top |
|
|
|