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

Editing Physical File name in COBOL MOdule


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

New User


Joined: 20 Apr 2006
Posts: 9

PostPosted: Wed Apr 14, 2010 8:07 am
Reply with quote

I was able to read DSN name of a dataset in COBOL module using TIOT parameters.

Would it be possible to EDIT this name of this dataset after the read.
Ex: After reading the dataset name as VGUNDU0.EPIC.TS
I tried moving/changing the name to VGUNDU0.E123.TS1.

The reason am doing this is because, the name can change and have a number which is dynamic and varies with each run.

This gave me a S0C4 abend which looked understandable.

Is there any way in which this can be done. I tried searching for past posts but couldn't find any relevant to this.
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 Apr 14, 2010 8:57 am
Reply with quote

Hello,

If your code works correctly the current dsn will be available - there is no reason to change it. The code would locate the proper dd and return the first dataset name used by that dd (concatenated datasets are an entirely different matter).

Even if you believe there is a reason to change the actual dataset name, you cannot. . .

Why do you believe you should change something that is managed by the operating system, not your code?

Possibly there is something i misunderstand. . .
Back to top
View user's profile Send private message
santosh.iim

New User


Joined: 20 Apr 2006
Posts: 9

PostPosted: Wed Apr 14, 2010 9:18 am
Reply with quote

Thank you for replying.

The reason i am planning to change the name of the file is that we usually give a file in the JCL in this fashion. (VGUNDU0.QYQ9999.XS3). The number 9999 is generic one in the JCL.

As of today, there is a Asembler module which reads this DSN, changes the 9999 to a number which is dynamic and then located in the same Assembler.

Our intention was to replace this Assembler code with COBOL and in the process we are trying to change the name of the file.

Sorry for causing confusion. Please let me know if this is clear enough to understand.
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 Apr 14, 2010 9:54 am
Reply with quote

Hello,

What you want is to name the file dynamically (if i understand). You can do this without trying to modify the system control block in your code.

Look here for starters:
ibmmainframes.com/viewtopic.php?t=46689

If you search the forum for BPXWDYN and PUTENV you will find multiple topics. . .
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top