IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

problem while Copy records from fileA to fileB.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Britto
Currently Banned

New User


Joined: 30 Dec 2011
Posts: 12
Location: INDIA

PostPosted: Thu Mar 08, 2012 3:50 pm
Reply with quote

Can anyone give me solution for following scenario:

File name no.of records
File A ---------> 100
File B ---------> none

When i copy File A to File B by using cobol program;system got abend due to data exception in 51th record in fileA .Now my files contain following Number of records.

File name no.of records
File A ---------> 100
File B ---------> 50

*Now i would like to make my application program start copying from 52nd record in fileA to fileB.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 08, 2012 3:59 pm
Reply with quote

Quote:
system got abend due to data exception


instead of your interpretation of the problem/error
cut and paste the actual error messages from your job.
was it an input data exception or an output data exception?

now, that aside,

what you want is restart logic.
which means you need to open you output file as mod instead of new or old
you need some kind of method to tell your program to skip the first 51 records in your input file
and start outputing from the 52nd.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 08, 2012 4:33 pm
Reply with quote

Unless you have specific requirements for restart logic, it is best to avoid it.

Do you have that requirement, specifically given to you, or is it some "good idea" of your own?

When you say you have 50 records in your output, is that because you have seen them/read them, or is it because the program must have written 50, so they must be there? If you have an ordinary sequential file, likely all those were sitting in buffers and when the program abended, I wouldn't count on them being written to the output file.

Did you trap the abend so that you could close all your files? No? Forget it then. Your output files contain garbage.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Thu Mar 08, 2012 7:25 pm
Reply with quote

Good day to all!

I agree with Bill that your output wouldn't be good for many reasons. If you are sure that the bad record is the 51st record and you don't want to solve your data exception for some reason. Then you should take your input run it thru a sort excluding the bad record and run your program with the output from the sort.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 08, 2012 7:41 pm
Reply with quote

Britto,

is this a classroom exercise?
otherwise there is no reason to be using a cobol program to copy records from one file to another.
and your explanation of the data exception is bogus.

and really, change this crap:

Occupation: PROGRAMMER ANALYST
Mainframe Skills: JCL,DB2,CICS,IMS DB,DATACOM,REXX
Back to top
View user's profile Send private message
Britto
Currently Banned

New User


Joined: 30 Dec 2011
Posts: 12
Location: INDIA

PostPosted: Thu Mar 08, 2012 8:28 pm
Reply with quote

There is no requirement as of now.i asked this question may be i would face this kind of problem when i move to production support in future.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 08, 2012 8:54 pm
Reply with quote

You probably won't. If you do, it will be well-documented, and no-one will let you near it unaided until you have the necessary skills.
Back to top
View user's profile Send private message
Britto
Currently Banned

New User


Joined: 30 Dec 2011
Posts: 12
Location: INDIA

PostPosted: Thu Mar 08, 2012 8:56 pm
Reply with quote

dbzTHEdinosauer,
i am not insist you post your suggestion.If you have answer if you have wish post your suggestion else stay where you are.

I will get suggestion from the people who got what i want.

anyway danks
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 08, 2012 9:05 pm
Reply with quote

EDIT: Words to the Unwise deleted.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top