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

Smart/restart logic implememtation


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Wed Jul 03, 2013 12:33 pm
Reply with quote

Hi ,

I am writing a cobol program where i copy one sequential file records to various output files. But i want to implement SMART/Restart logic. Please give me a stepwise solution of how i can implement it. What i want is a sample cobol program template and a sample JCL.

Thanks
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: Wed Jul 03, 2013 12:40 pm
Reply with quote

Assuming that you mean Smart/RESTART, why don't you consult the manuals or the vendor.

From their website "Knowledgeable and responsive support is available 24 hours a day, 7 days a week to supplement our clear and thorough product documentation."
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Wed Jul 03, 2013 12:58 pm
Reply with quote

Hi Bill,

Actually there is not enough documentation available. :-)

Thanks
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: Wed Jul 03, 2013 1:19 pm
Reply with quote

Explain that to your boss. Expect that they sort it out. Find out who is allowed to talk to the vendor. There may be no-one with experience of the product on this site, but there certainly is lots of knowledge with the vendor.

Anyway, if you are just copying one input to several outputs, have you considered using your SORT product? It'll be faster.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jul 03, 2013 2:52 pm
Reply with quote

Do you wanted to know restart logic for Cobol or Cobol-db2 program?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jul 03, 2013 3:21 pm
Reply with quote

shah.yameen wrote:
I am writing a cobol program where i copy one sequential file records to various output files.
Though I've not used SMART/restart ever however, curious to know - What type of output files are they? Are they QSAM (Sequential Files)?
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Wed Jul 03, 2013 4:05 pm
Reply with quote

ya, they are Physical Sequential Files
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jul 03, 2013 4:10 pm
Reply with quote

If they are sequential files, then how would you maintain the "position" in them, after an abend? I might sound silly but my experience is with GSAM, they are treated as "single occurence of IMS DB segment" and can serve the purpose for restart...
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Wed Jul 03, 2013 4:12 pm
Reply with quote

Using SMART/RESTART there will be actually autorestart process i.e it will restart by itself from the point where the abend occured. But we have to mention in JCL the parameter file which contains the Environment (PROFILE), Check Point frequency and wheter it is an Initial run or a restart run..and incase of restart files will be auto positioned .. Still lots of doubts because i used to do the restart using the old method by skipping teh records..

But need to do it using SMART/RESTART...
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Wed Jul 03, 2013 4:17 pm
Reply with quote

Here the basic intro :

www.google.ch/url?sa=t&rct=j&q=smart%20restart%20cobol&source=web&cd=4&ved=0CEUQFjAD&url=http%3A%2F%2Fwww.relarc.com%2Fdox%2Ff_srs5.pdf&ei=qQDUUcD_KpOg7Aaiv4HoAg&usg=AFQjCNEHiOqKUmO5qQ-m-FC8lIfCkEpDFg
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 03, 2013 9:05 pm
Reply with quote

Hello,

If the program only processes sequential data, why does someone believe a restart should be implemented. . . icon_confused.gif

There no reason that a purely sequential process needs a restart.
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Thu Jul 04, 2013 12:43 pm
Reply with quote

Mr. Scherrer

I would like to give you a Program description .. icon_smile.gif

I have one sequential file (XL2RF001) which contains records extracted from DB2 (hosted on z/os master ).

I have another system that runs on Abacus (z/os Slave) and it has data for 7 different environments.

what my program does is :
1.Reads the record from sequential file XL2RF001
2.Check the Target env
3. And write the record in one of the 7 target env sequential fiiles (which will be loaded to database on slave to respective env)

What if program abends in the middle ? At that time we should be having some mechanism to reset the poineters,data structures to the last sucessful commit point and We used to do this manually

But nowadays the Smart/Restart tool automates all this stuff for us and we dont have to write the Restart Logic by ourself anymore as it takes a snapshot of everything at the commit point and if abend occurs it will auto restart the program and will reset the structures as well as file pointers..
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 Jul 04, 2013 1:05 pm
Reply with quote

Bill Woodger wrote:
Assuming that you mean Smart/RESTART, why don't you consult the manuals or the vendor.

From their website "Knowledgeable and responsive support is available 24 hours a day, 7 days a week to supplement our clear and thorough product documentation."
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Thu Jul 04, 2013 1:10 pm
Reply with quote

i have resolved the Issue now.. icon_smile.gif

Thank you All..!!
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jul 04, 2013 2:56 pm
Reply with quote

shah.yameen wrote:
i have resolved the Issue now.. icon_smile.gif
Just curious about the solution, can you please share?
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Thu Jul 04, 2013 5:48 pm
Reply with quote

Mr Anuj Dhawan

Ya.. I have done it.. I have used the SMART/RESTART in my program and i forcefully abended my program and i resubmitted the job and it completed sucessfully from the point where it left off.. I had to modify the JCL also.. Thank GOD .. icon_smile.gif
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Thu Jul 04, 2013 7:20 pm
Reply with quote

I would like to share the solution.

Lets assume that we are dealing with sequential files . File1 is Input & File2 is output
Write the program as usual. Ie open the Input file, Output file.
read the record from the Input File unitl eof and write the record to the output file. Once you write the record perform a commit (logical commit). I dont know if anyone of you have used Delta Macros and we have a macro named HYQREST which can be used to perform the commit. the syantax is
.ADD HYQREST,COMMIT,FORCE=N

That was the program..

Now comming to JCL.

In JCL u have to include the Control Parameter File (specified in your Smart/restart maual) and set the Parameters like CHECKPOINT FREQUENCY,REPOSITIONING FILE DDNAMES,REPOSITION STYLE etc

Dats it..!! icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 05, 2013 9:20 pm
Reply with quote

Hello,

Quote:
What if program abends in the middle ? At that time we should be having some mechanism to reset the poineters,data structures to the last sucessful commit point and We used to do this manually
I suggest this is a design deficiency. The sequential run should process the input qsam file and create the needed outputs.

When the job successfully completes, the 7 files should be sent to the target system(s) and not before.

This does Not need a checkpoint/restart.
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Fri Jul 05, 2013 9:34 pm
Reply with quote

Mr scherrer

When the extraction process for each individual file is complete, we have to update the DB2 table for each order (status completed) .. Possibly an abend can occur while updating a table..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 05, 2013 9:57 pm
Reply with quote

Hello,

As long as the "rules" keep changing, it will be difficult (or impossible) to make usefuil suggestions/observations.

Until this last post of yours, we (i at least) understood the process only had sequential output.

Even with this new wrinkle i believe there is still NO reason to complicate things with a restart trying to syncronize the db and 7 qsam outputs. With the little i know about your process, i believe i would consider passing the input table(s) once, writing out the 7 qsam files. Then, in 7 steps, i would read the 7 new files and apply the changes to the database. Each step would force a cneckpoint at the end and if some kind of restart was needed, it is rather straightforward.

Again, this is only from the little i see here and may not work if there are more new "understandings".
Back to top
View user's profile Send private message
shah.yameen

New User


Joined: 03 Jul 2013
Posts: 11
Location: INDIA

PostPosted: Sat Jul 06, 2013 12:51 pm
Reply with quote

Mr scherrer,

My post was to seek a little help from your experience to implement the Smart/restart. I didnt mention the DB becoz i didnt want to divert anyones focus so that they start concentrating of databases. I wanted evryone to focus towards files only..

As far as your suggestion is concerned I really appreciate your valuable suggestion. Ya we could have done that without considering the restart stuff.. But its the Client SME who waned us to implement that..

Thanks icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jul 06, 2013 11:34 pm
Reply with quote

You're welcome icon_smile.gif

Please keep in mind that it is best to tell the whole tale even if you want a particular focus (or non-focus).

Good luck.

d
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jul 10, 2013 9:33 am
Reply with quote

Steve Miller said, "Take the money and run." I guess some say, "Take the info and run." icon_mad.gif
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 Finding faulty logic Subscript out of... COBOL Programming 5
This topic is locked: you cannot edit posts or make replies. Need assistance in job scheduling logic. Mainframe Interview Questions 2
No new posts Rexx Logic error while adding seperat... CLIST & REXX 3
No new posts PL/1 Callback address logic in z/OS C... PL/I & Assembler 1
No new posts IMS Restart Failure IMS DB/DC 4
Search our Forums:

Back to Top