View previous topic :: View next topic
|
Author |
Message |
babu_hi
New User
Joined: 11 Apr 2006 Posts: 93
|
|
|
|
I am receiveing data from called program,but the data is in Index table formamt.that data variable which is specified in called program is occurs 85 times and it is return in to calling program,now i want to written the data in to output file.how do i get code it in calling program.please find the code for more understanding?
In called(sub pgm) pgm:
05 LK-HISTIRY-TABLE.
10 LK-SUB PIC 9(03).
10 LK-HISTORY-INDEX OCCURS 85 TIMES.
15 LK-IND-CNTL-TBNAME PIC X(18).
MOVE CNTL-TBL-NME TO LK-IND-CNTL-TBNAME (LK-SUB).
In Calling(main pgm) pgm :
CALL CALL-PGM USING LINKAGE-AREA.
IF GOOD-RETURN OF LINKAGE-AREA
PERFORM 85 TIMES
MOVE LK-IND-CNTL-TBNAME (LK-SUB)
TO RETURN-TB-NAME
MOVE RETURN-TB-NAME TO OUTPUT-REC
WRITE OUTPUT-REC
END-PERFORM
But i am getting only one occurence data 85 times?how do i solve this problem? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
babu_hi,
in the called program, i only see you addressing 1 table item.
having no idea what the sub-module does, makes it difficult to suggestion solutions.
if your intent in the sub-module is to populate the 85 items, you need some kind of processing loop which would populate each item. |
|
Back to top |
|
|
birdy K
New User
Joined: 05 Mar 2008 Posts: 72 Location: chennai
|
|
|
|
Hi babu,
You are not increasing the LK-SUB value. Add 1 to LK-SUB within perform. I think I am right. |
|
Back to top |
|
|
jckraheja
New User
Joined: 19 May 2008 Posts: 13 Location: Pune
|
|
|
|
YEs birdy K....U r right ... if we increased LK-SUB by 1 after RETURN-TB-NAME then problem must be get resolved.... |
|
Back to top |
|
|
|