IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there any way to display a counter in the spool area


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jwell rymbei

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Wed Mar 01, 2006 1:11 pm
Reply with quote

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
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Wed Mar 01, 2006 1:21 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Mar 01, 2006 3:21 pm
Reply with quote

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
View user's profile Send private message
jsk

New User


Joined: 20 Feb 2006
Posts: 12

PostPosted: Wed Mar 01, 2006 3:22 pm
Reply with quote

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
View user's profile Send private message
jwell rymbei

New User


Joined: 14 Dec 2005
Posts: 22
Location: India

PostPosted: Wed Mar 01, 2006 3:55 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Mar 01, 2006 4:17 pm
Reply with quote

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
View user's profile Send private message
tksvv

New User


Joined: 17 Mar 2006
Posts: 6

PostPosted: Fri Mar 24, 2006 7:05 pm
Reply with quote

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
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Mar 24, 2006 7:29 pm
Reply with quote

You can diaplay counter value after close file .then u will get processed record count
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Mar 24, 2006 7:35 pm
Reply with quote

Please check ur PM
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Search string in job at regular Spool... CLIST & REXX 0
No new posts How to display the leading zeros of a... DB2 7
No new posts Capturing logs from spool dd JCL & VSAM 6
No new posts Sort counter to show records combination JCL & VSAM 2
Search our Forums:

Back to Top