Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic File name allocation using RM/COBOL 6.09

Status
Not open for further replies.

thane777

Programmer
Jun 17, 2005
2
US
Just wondering if there is any way to dynamically allocate filenames for output files using RM/COBOL. The code I am writing does not make use of JCL at all so that would not be an option.

Any suggestions?

thane777
 
look at the manual.

but basically you do as

select my_file ... assign to W-FICH

...


working storage

01 w-fich pic x(100).


....
move "my_file_1" to w-fich
open my_file
read my_file
close my_file

move "my_file_2" to w-fich
open my_file
read my_file
close my_file

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Yes, you can do this.

1. Use a data-item name instead of a literal in the ASSIGN clause of the SELECT statement, and store the pathname of the file as the value of the data-item prior to OPENing the file, as explained in the RM/COBOL Language Reference Manual; or

2. Use environment variables, as explained in the RM/COBOL User Guide.

BTW, 6.09 is an extremely old version. Have you considered upgrading?

Tom Morrison
 
Thanks, Tom. Yeah, I know our version is ancient. The plan is to ride with it until we switch to another platform. That was in the works before I began work here.

thane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top