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
 

 

problem while Copy records from fileA to fileB.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: problem while Copy records from fileA to fileB.
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Mar 08, 2012 4:33 pm    Post subject: Reply to: problem while Copy records from fileA to fileB.
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: 110
Location: Puerto Rico

PostPosted: Thu Mar 08, 2012 7:25 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: problem while Copy records from fileA to fileB.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Mar 08, 2012 8:54 pm    Post subject: Reply to: problem while Copy records from fileA to fileB.
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Mar 08, 2012 9:05 pm    Post subject: Reply to: problem while Copy records from fileA to fileB.
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    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: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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