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 

Table handling 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
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Wed Jul 14, 2004 10:32 am    Post subject: Table handling in easytrieve Reply with quote

Hi ,

we have a prob to displaying the table data in easytrieve.Table data is displayng only when hardcoded but not using the subscript.

For Ex:

name(1)
name(2)

is getting displayed, but

ctr = 1
name(ws-ctr)
ctr = ctr + 1
-name(ws-ctr)
isn't getting displayed , only the first occurence of table is populated in the both cases.

Thanks
Vk
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 14, 2004 11:02 am    Post subject: Reply with quote

Konakav,

Show your table definition and the subscript definiton. Also show us the logic as how you populated the table.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Thu Jul 15, 2004 5:42 am    Post subject: Reply with quote

Hi Kolusu,

Please find the below code.

Code:
W-DATES        W  36  A        +                           
               VALUE 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'
W-MMM                          +                           
        W-DATES          3  A OCCURS 12                         
W-CTR             W  2   N  VALUE 0                           

Code:
JOB INPUT NULL                                             
W-CTR    =   W-CTR +1                                     
W-MMM(W-CTR)                                             
  PRINT REPORT1                                           
STOP                 

Code:
REPORT REPORT1 SPACE 0 NOADJUST                           
CONTROL FINAL NOPRINT                                     
TITLE 1 '*TABLE REPORT*'
 LINE 1 COL 001   W-CTR                +
            COL 021   W-MMM(W-CTR)       

Thanks,
VK
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 15, 2004 11:15 am    Post subject: Reply with quote

Konakav,

You don't need a seperate variable for displaying the table contents. You can use INDEX phrase for the table and display the contents

Code:

                                                             
DEFINE W-DATES        W  36  A        +                       
               VALUE 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'   
DEFINE W-MMM   W-DATES   03  A OCCURS 12  INDEX W-CTR         
                                                             
JOB INPUT NULL                                               
                                                             
  W-CTR = 1                                                   
  DO UNTIL W-CTR > 12                                         
     PRINT REPORT1                                           
     W-CTR = W-CTR + 1                                       
  END-DO                                                     
  STOP                                                       
                                                             
REPORT REPORT1 SPACE 0 NOADJUST                               
CONTROL FINAL NOPRINT                                         
TITLE 1 '*TABLE REPORT*'                                     
LINE 1 COL 001   W-CTR                +                       
       COL 021   W-MMM(W-CTR)                                 


However if you still insist of defining a seperate variable then, the following code gives you the results

Code:

DEFINE W-DATES        W  36  A        +                     
               VALUE 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' 
DEFINE W-MMM   W-DATES   03  A OCCURS 12                     
DEFINE W-CTR   W 02 N 0                                     
                                                             
JOB INPUT NULL                                               
                                                             
  W-CTR = 1                                                 
  DO UNTIL W-CTR > 12                                       
     PRINT REPORT1                                           
     W-CTR = W-CTR + 1                                       
  END-DO                                                     
  STOP                                                       
                                                             
REPORT REPORT1 SPACE 0 NOADJUST                             
CONTROL FINAL NOPRINT                                       
TITLE 1 '*TABLE REPORT*'                                     
LINE 1 COL 001   W-CTR                +                     
       COL 021   W-MMM(W-CTR)                               


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Fri Jul 16, 2004 5:21 am    Post subject: Reply with quote

Hi Kolusu,

Excellent!!! both are working fine.

Thanks a lot,
Konakav
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