* Exchange "unformatted write" file between VMS and UNIX Fortran
@ 2000-11-01 9:48 Takashi Ichihara
2000-11-01 14:12 ` hein
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Takashi Ichihara @ 2000-11-01 9:48 UTC (permalink / raw)
Hi folks
I want to read a file at True64 UNIX, which was written at Open
VMS/AXP using Fortran "unformatted write" statement. But the following
errors occurs during the unformatted read at True64 UNIX, DEC Fortran.
forrtl: severe (24): end-of-file during read, unit 1, file testi.d
forrtl: severe (67): input statement requires too much data, unit 1,
file testi.d or
What I did is as follows:
(1) Write a file using Fortran "unformatted write" on VMS. (write.f)
(OpenVMS V6.2-1H3, DIGITAL Fortran 77 X7.1-156, UCX 4.2 ECO 2)
(2) Binary ftp the file testi.d from Open VMS/AXP to True64 UNIX
(3) Read the file using Fortran "unformatted read" on True64 UNIX (read.f)
(OSF1 V4.0 1229 alpha, DIGITAL Fortran 77 V5.2-171-428BH)
Then the read error occurs with the error messages above.
Is there any special method to transfer or convert file written by
"unformatted write" on Open VMS/AXP Fortran to True64 UNIX System ?
Thanks for the information.
Very simple example of the program is as follows:
(write.f) : execute at Open VMS/AXP
integer*4 IX(1024)
data IX/1024*0/
IX(1)=1
IX(1024)=1024
open(1,file='testi.d',status='new',form='UNFORMATTED')
write(1) ix
stop
end
Binary ftp the file (testi.d) from Open VMS/AXP to True 64 Unix and then
(read.f) : execute at True64 Unix
integer*4 IX(1024)
open(1,file='testi.d',status='old',form='UNFORMATTED')
read(1) ix
write(6,*) IX(1),IX(1024)
stop
end
Result: forrtl: severe (24): end-of-file during read, unit 1, file testi.d
Takashi Ichihara (ichihara @ riken.go.jp)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Exchange "unformatted write" file between VMS and UNIX Fortran
2000-11-01 9:48 Exchange "unformatted write" file between VMS and UNIX Fortran Takashi Ichihara
@ 2000-11-01 14:12 ` hein
2000-11-01 14:48 ` Kenneth Randell
2000-11-02 1:17 ` Takashi Ichihara
2 siblings, 0 replies; 4+ messages in thread
From: hein @ 2000-11-01 14:12 UTC (permalink / raw)
In article <8tootl$gov$1@riksun.riken.go.jp>, ichihara@rarfaxp.riken.go.jp (Takashi Ichihara) writes...
> I want to read a file at True64 UNIX, which was written at Open
>VMS/AXP using Fortran "unformatted write" statement. But the following
>errors occurs during the unformatted read at True64 UNIX, DEC Fortran.
Unfortunatly the Unix systems I have access to, currently do not have
Fortran installed. So I can only help by outlining wht i would have done.
Anyway, on VMS the fortran program will generate a 'variable length'
record file with maximum record size 2044 where each file record is
a part (segment) of the application data record. To implement this,
there is a header value for each segment (= rms record) which indicates
whether this segment is the first (1), middle (0), last(2) or only(3) one
needed to build an application record. Use DUMP/RECORD to verify.
> (2) Binary ftp the file testi.d from Open VMS/AXP to True64 UNIX
That means you have send the record length 'overhead' words (in the
test case values 2044, 2044 and 14 over to Unix. DOes it know what
to do with that? Use DUMP/BLOC to verify. On Unix use some flavor of 'od'
> (3) Read the file using Fortran "unformatted read" on True64 UNIX (read.f)
> (OSF1 V4.0 1229 alpha, DIGITAL Fortran 77 V5.2-171-428BH)
Here I'd suggest you run the file creation program on Unix and dump (od)
the resulting file to understand the implemenation. Actually, in reality
i would probably do a binary transfer to VMS and DUMP it there.
Once you know how the Unix file should look like, I am sure you can find
a way on VMS to create it just so. Maybe all it takes is FTP in text mode
(I doubt it, considering the binary data). Maybe it takes a $CONVERT to
STREAM_LF (again, unlikely if there is binary data, but maybe).
The FOrtran documentation on Unix should also explain what data is expected.
hth,
Hein
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Exchange "unformatted write" file between VMS and UNIX Fortran
2000-11-01 9:48 Exchange "unformatted write" file between VMS and UNIX Fortran Takashi Ichihara
2000-11-01 14:12 ` hein
@ 2000-11-01 14:48 ` Kenneth Randell
2000-11-02 1:17 ` Takashi Ichihara
2 siblings, 0 replies; 4+ messages in thread
From: Kenneth Randell @ 2000-11-01 14:48 UTC (permalink / raw)
Hello --
I don't have a TRU64 UNIX to test this myself, but in no particular order:
1) Did you try the ftp transfer in text (vs. binary) mode?
2) Are you sure the 'format' of the TRU64 unformatted data files is the same
as on VMS? On VMS, each unformatted record is a 'logical record', which is
implemented as a series of one or more variable length records with a
two-byte header (values 00 - 03) that dictates which 'part' of a 'logical'
record it is -- first record, last record, 'middle record', and only record.
This allows the unformatted records to be of arbitrary length. I am
uncertain of the TRU64 implementation.
Perhaps Steve Lionel of COMPAQ will be able to clear this up.
Ken Randell
Takashi Ichihara wrote in message <8tootl$gov$1@riksun.riken.go.jp>...
> Hi folks
>
> I want to read a file at True64 UNIX, which was written at Open
>VMS/AXP using Fortran "unformatted write" statement. But the following
>errors occurs during the unformatted read at True64 UNIX, DEC Fortran.
>
> forrtl: severe (24): end-of-file during read, unit 1, file testi.d
>
> forrtl: severe (67): input statement requires too much data, unit 1,
> file testi.d or
>
> What I did is as follows:
>
> (1) Write a file using Fortran "unformatted write" on VMS. (write.f)
> (OpenVMS V6.2-1H3, DIGITAL Fortran 77 X7.1-156, UCX 4.2 ECO 2)
>
> (2) Binary ftp the file testi.d from Open VMS/AXP to True64 UNIX
>
> (3) Read the file using Fortran "unformatted read" on True64 UNIX
(read.f)
> (OSF1 V4.0 1229 alpha, DIGITAL Fortran 77 V5.2-171-428BH)
>
> Then the read error occurs with the error messages above.
>
> Is there any special method to transfer or convert file written by
>"unformatted write" on Open VMS/AXP Fortran to True64 UNIX System ?
>Thanks for the information.
>
> Very simple example of the program is as follows:
>
>(write.f) : execute at Open VMS/AXP
> integer*4 IX(1024)
> data IX/1024*0/
> IX(1)=1
> IX(1024)=1024
> open(1,file='testi.d',status='new',form='UNFORMATTED')
> write(1) ix
> stop
> end
>
>Binary ftp the file (testi.d) from Open VMS/AXP to True 64 Unix and then
>
>(read.f) : execute at True64 Unix
> integer*4 IX(1024)
> open(1,file='testi.d',status='old',form='UNFORMATTED')
> read(1) ix
> write(6,*) IX(1),IX(1024)
> stop
> end
>
>Result: forrtl: severe (24): end-of-file during read, unit 1, file testi.d
>
> Takashi Ichihara (ichihara @ riken.go.jp)
>
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Exchange "unformatted write" file between VMS and UNIX Fortran
2000-11-01 9:48 Exchange "unformatted write" file between VMS and UNIX Fortran Takashi Ichihara
2000-11-01 14:12 ` hein
2000-11-01 14:48 ` Kenneth Randell
@ 2000-11-02 1:17 ` Takashi Ichihara
2 siblings, 0 replies; 4+ messages in thread
From: Takashi Ichihara @ 2000-11-02 1:17 UTC (permalink / raw)
<8tootl$gov$1@riksun.riken.go.jp> I wrote
>> I want to read a file at True64 UNIX, which was written at Open
>> VMS/AXP using Fortran "unformatted write" statement. But the following
>> errors occurs during the unformatted read at True64 UNIX, DEC Fortran.
>>
>> forrtl: severe (24): end-of-file during read, unit 1, file testi.d
>>
>> forrtl: severe (67): input statement requires too much data, unit 1,
>> file testi.d or
>>
>> What I did is as follows:
>>
>> (1) Write a file using Fortran "unformatted write" on VMS. (write.f)
>> (OpenVMS V6.2-1H3, DIGITAL Fortran 77 X7.1-156, UCX 4.2 ECO 2)
>>
>> (2) Binary ftp the file testi.d from Open VMS/AXP to True64 UNIX
>>
>> (3) Read the file using Fortran "unformatted read" on True64 UNIX (read.f)
>> (OSF1 V4.0 1229 alpha, DIGITAL Fortran 77 V5.2-171-428BH)
>>
>> Then the read error occurs with the error messages above.
>>
>> Is there any special method to transfer or convert file written by
>> "unformatted write" on Open VMS/AXP Fortran to True64 UNIX System ?
>> Thanks for the information.
I got an answer from telephon support center of Compaq Japan just now.
The suggested method is as follows:
(1) Convet a file to fix record format at the OPEN/VMS using the
following command:
$ set file /attr=(rfm=fix,lrl=512) testi.d
(2) Copy the file from VMS to True64 UNIX via binary-mode FTP
(3) At True64 Unix, Open the file with the special option
RECORDTYPE='segmented'
(this option seems to be special to the True64 DEC Frortan)
open(1,file='testi.d',status='old',form='UNFORMATTED',
1 RECORDTYPE='segmented')
Then it worked. Thanks for the information and suggestions.
Takashi Ichihara (ichihara @ riken.go.jp)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-11-02 1:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-01 9:48 Exchange "unformatted write" file between VMS and UNIX Fortran Takashi Ichihara
2000-11-01 14:12 ` hein
2000-11-01 14:48 ` Kenneth Randell
2000-11-02 1:17 ` Takashi Ichihara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox