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 handle a restart logic in cobol pgm & embedded SQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Wed Dec 07, 2005 4:57 pm    Post subject: How to handle a restart logic in cobol pgm & embedded SQ
Reply with quote

hi guyz,
can anyone tell me how to handle a restart logic in cobol pgm(for file) and for embedded sql(cobol db2).
say i'm loading 100 recs from a file to another file.while 50th record it got abend.now instead of starting from 1st rec again i need to start from 51st rec.how to do this using the logic in cobol file program.

now in cobol db2 pgm i'm loading the 100 recs from file to db2 table.it got abend in 51st record.now how to put a commit point after 50 records and how to start from 51st record.
my ques is how do u handle these situations(with logics).

thanx and regards
shammi.
Back to top
View user's profile Send private message

Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Thu Dec 08, 2005 4:13 am    Post subject:
Reply with quote

For file, one way I can think of is: If you can add or use a indicator in the input file, set the indicator for a record as and when it is loaded to the output file. While writing, write only those records for which the indicator is not set.

i.e

Code:

Read record
If inidcator not set
do
   write to output
   set indicator
end
Go to Read record


However you do this, remember that your output file should have the DISP as (NEW,CATLG,KEEP) and not (NEW,CATLG,DELETE)
Back to top
View user's profile Send private message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Thu Dec 08, 2005 1:40 pm    Post subject: Re: How to handle a restart logic in cobol pgm & embedde
Reply with quote

thanx for ur prompt reply ramya....

i have 1 more ques...what'll happen if i try to load an empty file to a ksds or esds.
Back to top
View user's profile Send private message
shammiullah

New User


Joined: 13 Jun 2005
Posts: 24

PostPosted: Thu Dec 08, 2005 1:53 pm    Post subject:
Reply with quote

However you do this, remember that your output file should have the DISP as (NEW,CATLG,KEEP) and not (NEW,CATLG,DELETE)????

as u have said why cant be my outfile be (new,catlg,keep)....is there any reason behind it.

thanx and regards
shammi.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Dec 08, 2005 2:50 pm    Post subject: file
Reply with quote

Hi Shammiullah,

Quote:
what'll happen if i try to load an empty file to a ksds or esds.


i think 93 or 46 error u may get in file status... not clear..

Quote:
(new,catlg,keep)....is there any reason behind it.


i can't follow ur conversation... any how if u say i may help u...
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Sat Dec 10, 2005 1:32 am    Post subject:
Reply with quote

If you try to load an empty file to a ksds or esds, it will abend since VSAM files can never processed empty. Normally, in our shop we use to load the VSAM file with a dummy record as soon as it is created.

If you give (New,Catlg,Delete), in case your program abends, the dataset will be deleted. So whatever data you've loaded so long (Your basic requirement) will no longer be there. So if you restart your step, you'll have to start from first again.

Hope I'm clear.
Back to top
View user's profile Send private message
vijayprabu

New User


Joined: 15 Dec 2005
Posts: 21

PostPosted: Thu Dec 15, 2005 7:27 pm    Post subject: try thi
Reply with quote

Hi,

1. sort the input file.
2. after reading and writing into the output file write the same record into another file and disp as (new,catlg,keep)
3. whenever the program restarts first read the file which is kept till end of file.
4. you will get the last record written into the output file.
5. then go to the normal process of reading and writing.

I hope this works

if any mistakes execuse......

vijay
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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