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 delete the o/p file when the o/p file has no records

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

New User


Joined: 26 Apr 2011
Posts: 2
Location: chennai

PostPosted: Tue Apr 26, 2011 10:24 am    Post subject: how to delete the o/p file when the o/p file has no records
Reply with quote

I want to create a cobol program fro the below requirement..

Reqmt: Input file has 3 types of Accounts. We want to segregate and write these 3 types of accounts to 3 different files. if any one of the o/p file was empty . it should not create even an empty file(this case should be handled in cobol program itself).

Can any one help me how to resolve 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 Apr 26, 2011 10:59 am    Post subject:
Reply with quote

Unless the files are dynamically allocated by the COBOL program,
(output for a file is determined as yes)
you will need to have a succession of 3 IEFBR14's,
each referencing with a DISP=(old,delete,delete) one of the files,
and having a double
[e.g. (rc=1)or(rc=4)] (syntax found in JCL reference manual and the users guide - great write-up)
COND CODE= parm for the EXEC parm,
or an IF,
controlled by the Return-code of the COBOL program.
Back to top
View user's profile Send private message
y5cs878

New User


Joined: 26 Apr 2011
Posts: 2
Location: chennai

PostPosted: Tue Apr 26, 2011 11:04 am    Post subject:
Reply with quote

Thanks for the Quick response

Can you provide any exanmple for dyanmic flie allocation in COBOL.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 26, 2011 11:36 am    Post subject:
Reply with quote

many topics here in the forum.

because I consider dynamic file allocation in COBOL,
something that i feel application programmers should not do
you can search yourself in this forum. lots of topics and solutions.

if you are an application programmer, you will have to dig,
if you are a systems type, then the info is also there.

you are lucky,
my girlfriend is showing up soon
so, I will refrain from making any negative remarks,
though it is obvious that I want to make some.
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 Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm


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