Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* VAX Fortran - "Encode" Statement
@ 2000-02-01  5:00 Paul Roskos
  2000-02-01  5:00 ` Steve Lionel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paul Roskos @ 2000-02-01  5:00 UTC (permalink / raw)


Hello,

My company recently removed two DEC VAX computers from service, a
6310 and 8810. The 8810 had a Fortran program that I need to
convert to a version of Fortran that runs on a PC.

The program contains several statements of the form,
"ENCODE(1,10,File(4)) PASS(1)." Could anyone tell me what the
"Encode" statement does?

Thanks very much for any help.

--
Paul Roskos






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: VAX Fortran - "Encode" Statement
  2000-02-01  5:00 VAX Fortran - "Encode" Statement Paul Roskos
  2000-02-01  5:00 ` Steve Lionel
  2000-02-01  5:00 ` Serguei Patchkovskii
@ 2000-02-01  5:00 ` Dave Greenwood
  2000-02-02  5:00 ` Thanks for "Encode" Help Paul Roskos
  3 siblings, 0 replies; 5+ messages in thread
From: Dave Greenwood @ 2000-02-01  5:00 UTC (permalink / raw)


Paul Roskos wrote:
> 
> Hello,
> 
> My company recently removed two DEC VAX computers from service, a
> 6310 and 8810. The 8810 had a Fortran program that I need to
> convert to a version of Fortran that runs on a PC.
> 
> The program contains several statements of the form,
> "ENCODE(1,10,File(4)) PASS(1)." Could anyone tell me what the
> "Encode" statement does?
> 
> Thanks very much for any help.
> 
> --
> Paul Roskos

Encode is equivalent to an internal write statement.  Basically,
the code is writing 1 byte of binary data from PASS(1) into File(4)
using the format statement labelled 10.

Dave 
--------------
Dave Greenwood                Internet: Greenwoodde@ORNL.GOV
Oak Ridge National Lab        %STD-W-DISCLAIMER, I only speak for myself



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: VAX Fortran - "Encode" Statement
  2000-02-01  5:00 VAX Fortran - "Encode" Statement Paul Roskos
@ 2000-02-01  5:00 ` Steve Lionel
  2000-02-01  5:00 ` Serguei Patchkovskii
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Steve Lionel @ 2000-02-01  5:00 UTC (permalink / raw)


On Tue, 01 Feb 2000 14:27:46 -0500, Paul Roskos <paul.roskos@bms.com>
wrote:

>My company recently removed two DEC VAX computers from service, a
>6310 and 8810. The 8810 had a Fortran program that I need to
>convert to a version of Fortran that runs on a PC.
>
>The program contains several statements of the form,
>"ENCODE(1,10,File(4)) PASS(1)." Could anyone tell me what the
>"Encode" statement does?

Well, if you use Compaq Visual Fortran, you don't have to convert it -
ENCODE is supported.

ENCODE is an extension that performs a function similar to the Fortran
77 standard "internal WRITE" statement (ENCODE predates F77).  The
statement you show says write one character, using FORMAT 10, into
array element FILE(4) the formatted value of PASS(1).  FILE is
probably an INTEGER array though it could be CHARACTER or any type.
If it happened to be CHARACTER*1, a F77 equivalent might be:

	WRITE (FILE(4), 10) PASS(1)

See
http://www.digital.com/fortran/docs/lrm/lrm0632.htm#encode_decode_stmts
for more information on ENCODE/DECODE.


Send Visual Fortran support requests to vf-support@compaq.com

Steve Lionel (mailto:Steve.Lionel@compaq.com)
Fortran Engineering
Compaq Computer Corporation, Nashua NH

Compaq Fortran web site: http://www.compaq.com/fortran
Compaq Fortran Message Board: 
   http://forum.compaq.com:80/mb8/system/fortran_login.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: VAX Fortran - "Encode" Statement
  2000-02-01  5:00 VAX Fortran - "Encode" Statement Paul Roskos
  2000-02-01  5:00 ` Steve Lionel
@ 2000-02-01  5:00 ` Serguei Patchkovskii
  2000-02-01  5:00 ` Dave Greenwood
  2000-02-02  5:00 ` Thanks for "Encode" Help Paul Roskos
  3 siblings, 0 replies; 5+ messages in thread
From: Serguei Patchkovskii @ 2000-02-01  5:00 UTC (permalink / raw)


Paul Roskos (paul.roskos@bms.com) wrote:
: The program contains several statements of the form,
: "ENCODE(1,10,File(4)) PASS(1)." Could anyone tell me what the
: "Encode" statement does?

ENCODE() certainly predates VAXen; I used it on PDP-11s with pre-77
Fortran - so your code is *really* old. ENCODE is basically equivalent
to internal formatted WRITE(), which didn't exist in those times.
One of the arguments will be FORMAT label, another one will be the
output location, but the exact order of those and the meaning of the
third parameter escapes me after all this time ...

Regards,

/Serge.P

--
home page: http://www.cobalt.chem.ucalgary.ca/ps/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Thanks for "Encode" Help
  2000-02-01  5:00 VAX Fortran - "Encode" Statement Paul Roskos
                   ` (2 preceding siblings ...)
  2000-02-01  5:00 ` Dave Greenwood
@ 2000-02-02  5:00 ` Paul Roskos
  3 siblings, 0 replies; 5+ messages in thread
From: Paul Roskos @ 2000-02-02  5:00 UTC (permalink / raw)


Just wanted to thank everyone for the information, expecially the
function description provided by Steve Lionel. Thanks to you help, I
will be able to convert the program to a more current version of
Fortran.

Also a note to Sequei Patchkovskii, you are 100% correct. Most of
this program was originally coded for a PDP-11/70 in the late 1970's
and then converted to the VAXs in the early 1980's.

I had not personally worked on a VAX for over 10 years, and the
meaning of the "Encode" had escaped me. Fortunately, all of you
remembered. Thanks again for your help!

Paul Roskos


Paul Roskos wrote:

> Hello,
>
> My company recently removed two DEC VAX computers from service, a
> 6310 and 8810. The 8810 had a Fortran program that I need to
> convert to a version of Fortran that runs on a PC.
>
> The program contains several statements of the form,
> "ENCODE(1,10,File(4)) PASS(1)." Could anyone tell me what the
> "Encode" statement does?
>
> Thanks very much for any help.
>
> --
> Paul Roskos







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-02-02  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-01  5:00 VAX Fortran - "Encode" Statement Paul Roskos
2000-02-01  5:00 ` Steve Lionel
2000-02-01  5:00 ` Serguei Patchkovskii
2000-02-01  5:00 ` Dave Greenwood
2000-02-02  5:00 ` Thanks for "Encode" Help Paul Roskos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox