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: 10274
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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