View previous topic :: View next topic
|
Author |
Message |
Praveen Bhat
New User
Joined: 26 Aug 2008 Posts: 7 Location: Chennai
|
|
|
|
Hello all,
Question: Is there any way to rename a dataset from with in COBOL batch program? Or even better, a utility/module to do this?
Scenario: Dataset is being processed in a COBOL batch program, if processing fails for any reason (be it file processing, DB2 or any other) file processing is skipped. The file is picked up for processing (based on dataset mask, for instance ENV.SYS.DATE.*) in the next schedule run for processing. The program could fail for the same reason regardless of any number of retrys. Need to rename the dataset after specified number of reprocessing attempts, so the job would not pickup the job for processing any more.
Thanks,
Praveen |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Praveen,
Quote: |
Is there any way to rename a dataset from with in COBOL batch program? Or even better, a utility/module to do this? |
This question looks very strange to me. Why do you want to do that? dataset is referred in the JCL and if at all you want to rename the dataset you will have to do it in the JCL. The link between the JCL and the COBOL program w.r.t the file is through the DD NAME.
Quote: |
The program could fail for the same reason regardless of any number of retrys |
What is it to do with the filename? How would renaming solve the problem?
You will have to explain the requirement clearly. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
You can include and IKJEFT01 step and execute RENAME command through that. I could not get the "specified number of reprocessing attempts" though. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Ag,
Quote: |
You can include and IKJEFT01 step and execute RENAME command through that |
Do you want to add a IKJEFT01 step in the JCL?
If i had understood correctly OP wanted to rename the dataset in a COBOL program. Am i wrong? |
|
Back to top |
|
|
Praveen Bhat
New User
Joined: 26 Aug 2008 Posts: 7 Location: Chennai
|
|
|
|
That's right, I need to change the dataset name from with in the program. The idea is to not include additional steps in the job, because of JCL step restrictions (read further).
The scenario in detail here:
These steps are performed every hour
1. LISTCAT used to pick up datasets with mask ENV.SYS.DATE.*
2. In-house utility to create dynamic job to processes as many as 255 datasets
3. Dynamic job to process the datasets
4. Delete all the datasets which were successfully processed
So where the above set is run again the next hour, the datasets processed successfully will not be picked up again. Few datasets may fail due to data problem, this would happen again and again regardless how many times it is processed in a day. So if the failed datasets are renamed, LISTCAT would not pickup for subsequent processing. The renaming of the dataset is to process them manually after fixing the data issue.
I don't want to include a new step the rename the datasets, just to ensure that at least 255 datasets would be processed (attempted) each run.
So, is it possible to rename dataset from with in the program? Micro Focus COBOL has CBL_RENAME_FILE for this purpose; is there any thing similar to this for use in System z?
Thanks,
Praveen |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Praveen,
Thanks for explaining your requirements clearly but I have few questions.
Quote: |
1. LISTCAT used to pick up datasets with mask ENV.SYS.DATE.* |
Are you executing a seperate job for this? or REXX?
Quote: |
Delete all the datasets which were successfully processed
|
How are you deleting the datasets? Again a JOB? or ???
Based on your answer I can suggest you few things. |
|
Back to top |
|
|
Praveen Bhat
New User
Joined: 26 Aug 2008 Posts: 7 Location: Chennai
|
|
|
|
Hello,
Quote: |
Are you executing a seperate job for this? or REXX? |
A REXX tool is run using IKJEFT1A in a job
Quote: |
How are you deleting the datasets? Again a JOB? or ??? |
Again a REXX tool run in a job, both REXX used are in-house tools.
Hope to find some answers!!!
Thanks,
Praveen |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Praveen,
Quote: |
Again a REXX tool run in a job, both REXX used are in-house tools. |
If you can use a REXX tool for deleting the datasets, why not use a REXX tool for renaming the datasets?
If you are deleting the datasets which have run successfully why not rename the datasets which have failed? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
Or even better, a utility/module to do this? |
OP,
My solution fits to the 'even better' clause in the question. You never mentioned about JCL step restriction in original post. |
|
Back to top |
|
|
|