View previous topic :: View next topic
|
Author |
Message |
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
Hi Bill,
Actually there is not enough documentation available. :-)
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Do you wanted to know restart logic for Cobol or Cobol-db2 program? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
ya, they are Physical Sequential Files |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If the program only processes sequential data, why does someone believe a restart should be implemented. . .
There no reason that a purely sequential process needs a restart. |
|
Back to top |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
Mr. Scherrer
I would like to give you a Program description ..
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
i have resolved the Issue now..
Thank you All..!! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
shah.yameen wrote: |
i have resolved the Issue now.. |
Just curious about the solution, can you please share? |
|
Back to top |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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 .. |
|
Back to top |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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..!! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shah.yameen
New User
Joined: 03 Jul 2013 Posts: 11 Location: INDIA
|
|
|
|
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 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Steve Miller said, "Take the money and run." I guess some say, "Take the info and run." |
|
Back to top |
|
|
|