View previous topic :: View next topic
|
Author |
Message |
Britto Currently Banned New User
Joined: 30 Dec 2011 Posts: 12 Location: INDIA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Britto Currently Banned New User
Joined: 30 Dec 2011 Posts: 12 Location: INDIA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Britto Currently Banned New User
Joined: 30 Dec 2011 Posts: 12 Location: INDIA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
EDIT: Words to the Unwise deleted. |
|
Back to top |
|
|
|