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

Can we add headings dynamically?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anjani33
Currently Banned

New User


Joined: 16 Mar 2007
Posts: 9
Location: pune

PostPosted: Fri Nov 16, 2007 3:01 pm
Reply with quote

Hi..
Can we add headings dynamically?
I want to prepare month sheet. & headings are dates.
eg. 01020304...
Please give solutions for this.
Thanks.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Nov 16, 2007 3:17 pm
Reply with quote

anjani33 wrote:
Hi..
Can we add headings dynamically?
Yes, headings are just data and can be changed dynamically.....
Back to top
View user's profile Send private message
anjani33
Currently Banned

New User


Joined: 16 Mar 2007
Posts: 9
Location: pune

PostPosted: Fri Nov 16, 2007 4:41 pm
Reply with quote

hi murmohk1

ok. I am specify the details about my question.
The format is like

no. name. 01 02 03 04 & upto 30.

here we want increment & display both simultaneously for date.
this is heading for report. & it is presentee report.

eg.
Code:
no.name     01 02 03 04 05
01 abc       p  p  p  p  p
02 bca       p  a  p  p  p
03 cba       p  p  a  p  p
04 xyz       p  a  p  p  p


I think this explain is fine.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Nov 17, 2007 6:46 am
Reply with quote

Hello Anjani and welcome to the forums,

Quote:
I think this explain is fine.
Not yet.

Please post your example using the "Code" tag near the top of the reply panel. Also, please post more detail about your requirement. What you want to do is not clear.

When you post "data" it is a good idea to click Preview to see how your post will appear to the forum (rather than the screen where you type). When you are satisfied with the appearance and content, then click Submit.
Back to top
View user's profile Send private message
anjani33
Currently Banned

New User


Joined: 16 Mar 2007
Posts: 9
Location: pune

PostPosted: Mon Nov 19, 2007 2:08 pm
Reply with quote

Hi,
I had given the code according to my thinking.
I want to increase count & display it on same line.
Here every time value is displayed on next line.

IDENTIFICATION DIVISION.
PROGRAM-ID. SIMPLE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 GROUP1.
05 DATES PIC 9(2) OCCURS 15.
05 CNT PIC 9(2) VALUE 1.

PROCEDURE DIVISION.
MOVE 1 TO DATES(CNT).
PERFORM VARYING CNT FROM 1 BY 1 UNTIL DATES(CNT) > 30
MOVE CNT TO DATES(CNT)
DISPLAY DATES(CNT)
END-PERFORM.
STOP RUN.

Thanks.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Nov 19, 2007 4:12 pm
Reply with quote

Anjani,

Quote:
PERFORM VARYING CNT FROM 1 BY 1 UNTIL DATES(CNT) > 30
MOVE CNT TO DATES(CNT)
DISPLAY DATES(CNT)
END-PERFORM.

Remove 'display' inside 'perform' loop. Provide DISPLAY DATES after 'end-perform' statement.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Mon Nov 19, 2007 4:42 pm
Reply with quote

Quote:
05 DATES PIC 9(2) OCCURS 15.
Also i think you need to increase this clause to 30.... otherwise data overwritten may happen.....
correct me if i'm wrong...
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Mon Nov 19, 2007 4:43 pm
Reply with quote

Hi anjani,

Why don't you try with some header like

Code:


Working-storage section.
01 hd1.
     05 No   pic x(2) value "NO".
     05 Name pic x(15) value "NAME".
     05 d1 pic x(2).
     05 filler pic x(2) value spaces.
     05 d2 pic x(2).
     05 filler pic x(2) value spaces.
     ..
     ..
     ..
     

Which ever date you want move it into the day field, name and no according to your requirement.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Nov 19, 2007 4:46 pm
Reply with quote

Vinay,

Quote:
Also i think you need to increase this clause to 30.... otherwise data overwritten may happen.....
correct me if i'm wrong...


Good point Vinay.
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 Dynamically pass table name to a sele... DB2 2
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts How to replace a string dynamically i... CLIST & REXX 16
No new posts Dynamically switching terminal model TSO/ISPF 9
No new posts Dynamically read input files using BP... COBOL Programming 23
Search our Forums:

Back to Top