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
 

 

Rename dataset dynamically from with in the program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Rename dataset dynamically from with in the program
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: 1288
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 3:05 pm    Post subject: Reply to: Rename dataset dynamically from with in the progra
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: 686
Location: Earth

PostPosted: Thu Dec 04, 2008 3:23 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 3:39 pm    Post subject: Reply to: Rename dataset dynamically from with in the progra
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    Post subject: Reply to: Rename dataset dynamically from with in the progra
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: 1288
Location: Chennai, India

PostPosted: Thu Dec 04, 2008 5:07 pm    Post subject: Reply to: Rename dataset dynamically from with in the progra
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    Post subject: Re: Reply to: Rename dataset dynamically from with in the pr
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: 1288
Location: Chennai, India

PostPosted: Fri Dec 05, 2008 12:46 pm    Post subject: Reply to: Rename dataset dynamically from with in the progra
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: 686
Location: Earth

PostPosted: Fri Dec 05, 2008 3:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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