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: 10211
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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