I need to find out how to, if possible, access the physical name of a file, eg; ACCOUNTS20250211 please.
------------------------------
Peter OFlanagan
Consultant
Rocket Forum Shared Account
------------------------------
I need to find out how to, if possible, access the physical name of a file, eg; ACCOUNTS20250211 please.
I need to find out how to, if possible, access the physical name of a file, eg; ACCOUNTS20250211 please.
Hi Peter,
I am not really sure what you are asking for.
Can you please provide some more detail on exactly what you need to do?
Thanks
Hi Peter,
I am not really sure what you are asking for.
Can you please provide some more detail on exactly what you need to do?
Thanks
Hi Chris, Thanks for getting back to me so quickly. I have been asked to see if it is possible to create a string within my program to contain the physical name of the file. So for arguments sake if I have a file ACCOUNTS20250211.txt is there a way to populate a PIC X(20) string as "ACCOUNTS20250211.txt "
Hi Chris, Thanks for getting back to me so quickly. I have been asked to see if it is possible to create a string within my program to contain the physical name of the file. So for arguments sake if I have a file ACCOUNTS20250211.txt is there a way to populate a PIC X(20) string as "ACCOUNTS20250211.txt "
Hi Peter,
Sure, you can use dynamic assignment in your select statement to assign the file to a data-item in working-storage.
identification division.
program-id. Program1.
environment division.
configuration section.
select test-file assign to my-file-name.
data division.
file section.
fd test-file.
01 test-rec pic x(10).
working-storage section.
01 my-file-name pic x(20) value spaces.
procedure division.
move "ACCOUNTS20250211.txt" to my-file-name
open output test-file
goback.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.