MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conditional TITLE or HEADING in Easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rg_nath
Beginner


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Wed Sep 02, 2015 12:49 pm    Post subject: Conditional TITLE or HEADING in Easytrieve Reply with quote

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


Joined: 26 Nov 2002
Posts: 12359
Topics: 75
Location: San Jose

PostPosted: Wed Sep 02, 2015 1:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
rg_nath
Beginner


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Wed Sep 02, 2015 1:09 pm    Post subject: Reply with quote

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


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Wed Sep 02, 2015 1:53 pm    Post subject: Reply with quote

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


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Thu Sep 03, 2015 12:42 am    Post subject: Reply with quote

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


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Sep 03, 2015 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group