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 add remaining fields in the output file

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Mon Oct 17, 2011 12:24 am    Post subject: how to add remaining fields in the output file
Reply with quote

Hi,
For eg:
SELECT NO,NAME,COURSE FROM EMP;

123 XXX MATHS
356 YYY PHYSICS

How to write the file all the records
In FOUT File

In COBOL-DB2 program I am reading all the records using cursor.

Code:

FETCH CURS01 INTO :NO,:NAME,:COURSE
PERFORM UNTIL SQLCODE = 100
IF NO NOT= SPACE THEN
   MOVE 'A'  TO CLASS
   WRITE FOUT
END-IF
IF NAME NOT= SPACE THEN
   MOVE 'B'  TO CLASS
   WRITE FOUT
END-IF
IF COURSE NOT= SPACE THEN
   MOVE 'C'  TO CLASS
   WRITE FOUT
END-IF
FETCH CURS01 INTO :NO,:NAME,:COURSE
END-PERFORM

Excepted Result:
123XXXMATHS
346YYYPHYSICS

My output result is:
MATHS
PHYSICS

Anyone help me how to change the logic.[/code]
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Mon Oct 17, 2011 12:33 am    Post subject: Reply to: how to add remaining fields in the output file
Reply with quote

the snippet You posted is the same code in this duplicate post
http://www.ibmmainframes.com/viewtopic.php?t=56462&highlight=
with the variable names changed

topic locked

You were already told on how to change the logic !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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