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

Rename dataset dynamically from with in the program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Praveen Bhat

New User


Joined: 26 Aug 2008
Posts: 7
Location: Chennai

PostPosted: Thu Dec 04, 2008 12:14 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 3:05 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Dec 04, 2008 3:23 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 3:39 pm
Reply with quote

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
View user's profile Send private message
Praveen Bhat

New User


Joined: 26 Aug 2008
Posts: 7
Location: Chennai

PostPosted: Thu Dec 04, 2008 4:25 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 5:07 pm
Reply with quote

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
View user's profile Send private message
Praveen Bhat

New User


Joined: 26 Aug 2008
Posts: 7
Location: Chennai

PostPosted: Fri Dec 05, 2008 11:08 am
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Dec 05, 2008 12:46 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Dec 05, 2008 3:14 pm
Reply with quote

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
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 Using API Gateway from CICS program CICS 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top