View previous topic :: View next topic |
Author |
Message |
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Wed Sep 02, 2015 12:49 pm Post subject: Conditional TITLE or HEADING in Easytrieve |
|
|
Hi,
Is any chance to code TITLE conditionally in Easytrieve REPORT? I would like to print TITLE or HEADING in a report based on working storage variable value by using IF condition (if any). Like below.
Code: |
WS-CNTR W 02 N VALUE 1
WS-TIT1 W 06 A VALUE 'TITLE1'
WS-TIT2 W 06 A VALUE 'TITLE2'
FILE RPT1 PRINTER
JOB INPUT NULL
DO WHILE WS-CNTR LT 10
PRINT MYRPT
WS-CNTR = WS-CNTR + 1
END-DO
STOP
REPORT MYRPT PRINT RPT1
IF WS-CNTR = 2
TITLE 01 COL 40 WS-TIT1
END-IF
IF WS-CNTR = 7
TITLE 01 COL 40 WS-TIT2
END-IF
LINE 01 COL 40 WS-CNTR
|
How do i change above code to get my expected report? Please share me if any.
-Nath |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12360 Topics: 75 Location: San Jose
|
Posted: Wed Sep 02, 2015 1:06 pm Post subject: |
|
|
rg_nath,
why don't you just define 1 title variable and move the value into it ? _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Wed Sep 02, 2015 1:09 pm Post subject: |
|
|
Hi Kolusu,
Thanks for the idea. its a basic thing that i have to think before post. i will try it.
-Nath |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Wed Sep 02, 2015 1:53 pm Post subject: |
|
|
Be aware that a TITLE (or HEADING) only appears at the top of the page. To do what you seem perhaps to want you'd need to SEQUENCE on "something" so that all of one type of title will appear together., and you need to specify a CONTROL field which will use NEWPAGE, so you get to see your different titles in a logical manner. |
|
Back to top |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Thu Sep 03, 2015 12:42 am Post subject: |
|
|
Thanks William Collins for the information !!
So if i want to print the Title in logical manner, i have to specify 'CONTROL fld1' in REPORT statement.
-Nath |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Thu Sep 03, 2015 1:36 am Post subject: |
|
|
Yes. Although to see it with your data, as a test, you could specify a very small number of lines for a page. |
|
Back to top |
|
|
|
|