Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Heisenberg might have been here.


computers / comp.os.vms / VMS Cobol filename issue

SubjectAuthor
* VMS Cobol filename issueArne Vajhøj
+* Re: VMS Cobol filename issuejeffrey_dsi
|`* Re: VMS Cobol filename issueArne Vajhøj
| `- Re: VMS Cobol filename issueArne Vajhøj
`* Re: VMS Cobol filename issueJim Duff
 `- Re: VMS Cobol filename issueArne Vajhøj

1
VMS Cobol filename issue

<um1jic$13v9j$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32284&group=comp.os.vms#32284

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: VMS Cobol filename issue
Date: Thu, 21 Dec 2023 09:54:04 -0500
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <um1jic$13v9j$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Dec 2023 14:54:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99cc46ce40d56e463d3482f9e3804833";
logging-data="1178931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7yElKjzVMDyfDHb3t+CJGw2Yp8EzxdRc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rXNxxybdjjLAX5Cpm01Ea2LnQ5A=
Content-Language: en-US
 by: Arne Vajhøj - Thu, 21 Dec 2023 14:54 UTC

Even considering that in general I do not understand
Cobol, then this one has me puzzled.

How does one open a file with the filename being variable?

Docs says:

<quote>
On OpenVMS, if file-spec is not a literal, the compiler:
• Translates hyphens in the COBOL word to underline characters
• Treats the word as if it were enclosed in quotation marks
....
If you specify ASSIGN TO unquoted string, you need not specify this name
in the WORKING-STORAGE section. For example:

ASSIGN TO TEST1

This assignment would use "TEST1.DAT" on OpenVMS Alpha and I64.

On UNIX systems, you would specify:

ASSIGN TO "TEST1.DAT"

or:

ASSIGN TO TEST1
....
WORKING-STORAGE SECTION.
01 TEST1 PIC X(9) VALUE IS "TEST1.DAT".
</quote>

So easy to do in OSF/1 aka DUNIX aka Tru64, but how
does one do it on VMS??

Arne

Re: VMS Cobol filename issue

<um1sc9$15d67$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32286&group=comp.os.vms#32286

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jeffrey@digitalsynergyinc.com (jeffrey_dsi)
Newsgroups: comp.os.vms
Subject: Re: VMS Cobol filename issue
Date: Thu, 21 Dec 2023 09:24:25 -0800
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <um1sc9$15d67$1@dont-email.me>
References: <um1jic$13v9j$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Dec 2023 17:24:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5f6021f3c3f1e9c5a04f03cf4ee6e75c";
logging-data="1225927"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OhMA241P4Rb8J5dCTM3LTC2+frkYyDvE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:XipSnGu/8dGdDi3AUmUTPH4Z8iI=
In-Reply-To: <um1jic$13v9j$1@dont-email.me>
Content-Language: en-US
 by: jeffrey_dsi - Thu, 21 Dec 2023 17:24 UTC

On 12/21/23 06:54, Arne Vajhøj wrote:
> Even considering that in general I do not understand
> Cobol, then this one has me puzzled.
>
> How does one open a file with the filename being variable?
>
> Docs says:
>
> <quote>
> On OpenVMS, if file-spec is not a literal, the compiler:
> • Translates hyphens in the COBOL word to underline characters
> • Treats the word as if it were enclosed in quotation marks
> ...
> If you specify ASSIGN TO unquoted string, you need not specify this name
> in the WORKING-STORAGE section. For example:
>
> ASSIGN TO TEST1
>
> This assignment would use "TEST1.DAT" on OpenVMS Alpha and I64.
>
> On UNIX systems, you would specify:
>
> ASSIGN TO "TEST1.DAT"
>
> or:
>
> ASSIGN TO TEST1
> ...
> WORKING-STORAGE SECTION.
> 01 TEST1 PIC X(9) VALUE IS "TEST1.DAT".
> </quote>
>
> So easy to do in OSF/1 aka DUNIX aka Tru64, but how
> does one do it on VMS??
>
> Arne
>
>
>

The only way I've seen to make the filename in Cobol a variable is to
use a logical.

ASSIGN TO "TEST"

and before the program is run

$ DEFINE TEST PROD_DATA:MYFILE.DAT

Re: VMS Cobol filename issue

<um1vjd$15ve7$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32288&group=comp.os.vms#32288

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Cobol filename issue
Date: Thu, 21 Dec 2023 13:19:23 -0500
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <um1vjd$15ve7$1@dont-email.me>
References: <um1jic$13v9j$1@dont-email.me> <um1sc9$15d67$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Dec 2023 18:19:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99cc46ce40d56e463d3482f9e3804833";
logging-data="1244615"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18w8S0VvwAJol9Cv5CcDd+6FIr6e4/OZqk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ulYrrS8vqvYYqSBFlEoaLD1vcNc=
In-Reply-To: <um1sc9$15d67$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Thu, 21 Dec 2023 18:19 UTC

On 12/21/2023 12:24 PM, jeffrey_dsi wrote:
> On 12/21/23 06:54, Arne Vajhøj wrote:
>> Even considering that in general I do not understand
>> Cobol, then this one has me puzzled.
>>
>> How does one open a file with the filename being variable?

> The only way I've seen to make the filename in Cobol a variable is to
> use a logical.
>
> ASSIGN TO "TEST"
>
> and before the program is run
>
> $ DEFINE TEST PROD_DATA:MYFILE.DAT

Thanks.

Really weird.

I ended up with:

file-control.
select in-file assign to "INFNM" organization is line sequential.
....
working-storage section.
01 infnm pic x(5) value "INFNM".
01 cmd pic x(80).
01 cmdlen pic s9(8) comp.
01 tbl pic x(11) value "LNM$PROCESS".
....
procedure division.
main-paragraph.
call "lib$get_foreign" using by descriptor cmd, omitted, by
reference cmdlen
call "lib$set_logical" using by descriptor infnm, by descriptor
cmd(1:cmdlen), by descriptor tbl
open input in-file

Arne

Re: VMS Cobol filename issue

<um20b7$1633f$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32289&group=comp.os.vms#32289

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Cobol filename issue
Date: Thu, 21 Dec 2023 13:32:07 -0500
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <um20b7$1633f$1@dont-email.me>
References: <um1jic$13v9j$1@dont-email.me> <um1sc9$15d67$1@dont-email.me>
<um1vjd$15ve7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Dec 2023 18:32:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99cc46ce40d56e463d3482f9e3804833";
logging-data="1248367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Cnf6KdSJvhPMuaGXb84nPnPhtNQoBEgk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VxR9xcV+Z4dDHRutihnQN+l8yXQ=
Content-Language: en-US
In-Reply-To: <um1vjd$15ve7$1@dont-email.me>
 by: Arne Vajhøj - Thu, 21 Dec 2023 18:32 UTC

On 12/21/2023 1:19 PM, Arne Vajhøj wrote:
> On 12/21/2023 12:24 PM, jeffrey_dsi wrote:
>> On 12/21/23 06:54, Arne Vajhøj wrote:
>>> Even considering that in general I do not understand
>>> Cobol, then this one has me puzzled.
>>>
>>> How does one open a file with the filename being variable?
>
>> The only way I've seen to make the filename in Cobol a variable is to
>> use a logical.
>>
>> ASSIGN TO "TEST"
>>
>> and before the program is run
>>
>> $ DEFINE TEST PROD_DATA:MYFILE.DAT
>
> Thanks.
>
> Really weird.
>
> I ended up with:
>
> file-control.
>     select in-file assign to "INFNM" organization is line sequential.
> ...
> working-storage section.
> 01 infnm pic x(5) value "INFNM".
> 01 cmd pic x(80).
> 01 cmdlen pic s9(8) comp.
> 01 tbl pic x(11) value "LNM$PROCESS".
> ...
> procedure division.
> main-paragraph.
>     call "lib$get_foreign" using by descriptor cmd, omitted, by
> reference cmdlen
>     call "lib$set_logical" using by descriptor infnm, by descriptor
> cmd(1:cmdlen), by descriptor tbl
>     open input in-file

tbl is not necessary - LNM$PROCESS is default.

Arne

Re: VMS Cobol filename issue

<7ca6f318-b650-4ae8-8d7b-a8db89533bd9@bad.invalid>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32290&group=comp.os.vms#32290

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jim@bad.invalid (Jim Duff)
Newsgroups: comp.os.vms
Subject: Re: VMS Cobol filename issue
Date: Fri, 22 Dec 2023 09:36:17 +1100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <7ca6f318-b650-4ae8-8d7b-a8db89533bd9@bad.invalid>
References: <um1jic$13v9j$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="fa11543ffe39c564f13382b3e87842de";
logging-data="1316077"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EW04r3n9NmOTBLAlgfPxu"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oDrAdg+J1pUK+HTtOXGqtfhJPM0=
Content-Language: en-US, en-AU
In-Reply-To: <um1jic$13v9j$1@dont-email.me>
 by: Jim Duff - Thu, 21 Dec 2023 22:36 UTC

On 22/12/23 01:54, Arne Vajhøj wrote:
> Even considering that in general I do not understand
> Cobol, then this one has me puzzled.
>
> How does one open a file with the filename being variable?
>
> [snip]
>

By using that value of clause on the FD. Example:

identification division.
program-id. demo.

environment division.
input-output section.
file-control.
select in-file assign to junk
organization is line sequential.

data division.
file section.
fd in-file
value of id is file-name
record is varying in size.
01 inrec.
03 rec pic x(80).

working-storage section.
01 file-name pic x(20).

procedure division.
0-begin.
move "x.x" to file-name.
open input in-file.
read in-file at end continue.
display inrec.
0-end.
close in-file.
stop run.

Jim
--
https://www.eight-cubed.com

Re: VMS Cobol filename issue

<um2j7j$18qe7$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=32291&group=comp.os.vms#32291

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Cobol filename issue
Date: Thu, 21 Dec 2023 18:54:26 -0500
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <um2j7j$18qe7$1@dont-email.me>
References: <um1jic$13v9j$1@dont-email.me>
<7ca6f318-b650-4ae8-8d7b-a8db89533bd9@bad.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Dec 2023 23:54:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f1558765c61865d243cf68fed44a0f07";
logging-data="1337799"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/pXmp1sli8v48f2i+NgIdpVfxv+M8s7Y="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sutK/CwGXPPDe1wrQ9MWjIJBF9M=
Content-Language: en-US
In-Reply-To: <7ca6f318-b650-4ae8-8d7b-a8db89533bd9@bad.invalid>
 by: Arne Vajhøj - Thu, 21 Dec 2023 23:54 UTC

On 12/21/2023 5:36 PM, Jim Duff wrote:
> On 22/12/23 01:54, Arne Vajhøj wrote:
>> Even considering that in general I do not understand
>> Cobol, then this one has me puzzled.
>>
>> How does one open a file with the filename being variable?

> By using that value of clause on the FD.  Example:
>
> identification division.
> program-id. demo.
>
> environment division.
> input-output section.
> file-control.
>     select in-file assign to junk
>         organization is line sequential.
>
> data division.
> file section.
> fd in-file
> value of id is file-name
> record is varying in size.
> 01 inrec.
>    03 rec pic x(80).
>
> working-storage section.
> 01 file-name pic x(20).
>
> procedure division.
> 0-begin.
>     move "x.x" to file-name.
>     open input in-file.
>     read in-file at end continue.
>     display inrec.
> 0-end.
>     close in-file.
>     stop run.

That is way nicer than lib$set_logical.

Thanks.

Arne

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor