Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10327
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us