Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to WRITE sub pgm return data in to file in main pgm?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
babu_hi

New User


Joined: 11 Apr 2006
Posts: 93

PostPosted: Tue May 27, 2008 1:36 pm    Post subject: How to WRITE sub pgm return data in to file in main pgm?
Reply with quote

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

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 27, 2008 2:03 pm    Post subject:
Reply with quote

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

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Tue May 27, 2008 2:16 pm    Post subject:
Reply with quote

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

New User


Joined: 19 May 2008
Posts: 13
Location: Pune

PostPosted: Tue May 27, 2008 2:53 pm    Post subject: Reply to: How to WRITE sub pgm return data in to file in mai
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us