Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

FTP from DOS to Alpha VMS a File Containing CRLF

 
SOLVED
Go to solution
Ataikili
Frequent Advisor

FTP from DOS to Alpha VMS a File Containing CRLF

I don't know anything about VMS systems.
Sure Unix,AS400,Windows.

I Want To Transfer A File(a text file) to VMS from WinXP-DOS like that
1. Line EUROPA(CRLF)AFRICA
2. Line AMERICA
I Can't Find Any Character that means EOL for RMS...(I read it there is no)
If I transfer in Ascii it executes oll CRLFs
like
EUROPA
AFRICA
AMERICA
If I transfer in Binary it only look a string with 512 lenght...
like EUROPAAFRICAAMERICA

May be read hundreds of documents and forum entries especially here but i cant fix it.
I Think it is impossible.
Because RMS seems keeps file lines as diff records.
I may run a script(with DCL may be ) on VMS side after transferring the file?

I have 3 days to solve it...
Thanks a lot for your replies.
22 REPLIES 22
Steven Schweda
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

VMS version?

What are the bytes in the original file?
What defines an EOL in that file?

I thought that CR was a line delimiter on
DOS+Windows, so I don't understand how you
can get a CR in the middle of a line there.

> I Can't Find Any Character that means EOL
> for RMS...(I read it there is no)

It depends on the file's record format. In a
StreamCR file, it's CR. In a StreamLF file,
it's LF. In a (plain) Stream file, it's
CRLF. In some other formats, there is none,
but record lengths are included in the file,
to establish the record boundaries. Many
things are possible. What would you like?

> If I transfer in Binary it only look a
> string with 512 lenght...
> like EUROPAAFRICAAMERICA

What did you do to get this display? DUMP
/BYTE could tell you what's really in the
file.

ASCII FTP transfers tend to try to interpret
line endings according to the FTP RFC. As I
recall, CRLF is used to mark an EOL, so I
doubt that you can do an ASCII FTP transfer
and preserve a CRLF pair. The receiving
program will interpret it as an EOL. Which
agrees with your report.

> I have 3 days to solve it...

So you probably have less than that to
explain what's in the file you're trying to
transfer, and what you would like to see on
the VMS side.
Ken Robinson
Valued Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

The line terminator in VMS is CRLF.

I believe that's true for DOS, also, so I'm surprised that DOS doesn't treat this as 3 lines, as well.

How is this file being generated?

BTW, can you tell us what version of VMS and which TCP/IP package/version are being used.

Ken
Steven Schweda
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

> The line terminator in VMS is CRLF.

Sigh. No, it's not. If it were, then you'd
be able to find a CR and an LF in this file:

alp $ pipe write sys$output "aaaa" > eol.txt
alp $ dump /byte eol.txt

Dump of file ALP$DKA0:[SMS]EOL.TXT;1 on 15-AUG-2008 15:48:57.66
File ID (264693,333,0) End of file block 1 / Allocated 69

Virtual block number 1 (00000001), 512 (0200) bytes

00 00 00 00 00 00 FF FF 61 61 61 61 8D 01 00 06 ....aaaa........ 000000
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000010
[...]

Q: Where are they? (A: I don't see them.
Perhaps they're not there.)

As DIRE /FULL will show, this is one of the
more exotic formats, VFC (Variable-length
records with Fixed-length Control), with a
record byte count of 6, which includes the
two bytes of "noise" (01, 8D, the "Control"
stuff) at the front of the record, plus the
four "a" characters (and some more noise at
the end).
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

In VMS side there is a 3. party program FASTWIRE(a payment system program developed by logica). Then you can get incoming payment messages by creating a file from this programs's menu.
Also if you put a file in the same format , in the same directory then you can force it from a menu to read this messages.
Case is this...
I can create this file for incoming messages from FASTWIRE's menu and look it with EDIT.
I saw that
HEADER
MESSAGE1(it contains CR, LF, FF s and it seems as "CR" "LF" "FF")
TRAILER

Also i looked it with DIR/FULL
saw that sequential and carriage return carriage control on it

So sure in DOS side i can put CR LF FF to file and saw it as 3,4,5 lines... it is not a problem.
After i transfer my file i must see it as 3 record LIKE
HEADER
PAYMENT MESSAGE
TRAILER
Ken Robinson
Valued Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Sorry, wrong information.

Ken
Hein van den Heuvel
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

How do you get, how can you see, the in the middle of 'a line' on the PC side? How can you tell? Can you show us a (binary/hex dump).
It the file behave as you like on the PC?

You may want to apply some editting sequence for a known to be unique string (for example %CR%LF% at the PC side (perl?), tranfer, and un-edit back to real CR-LF., again with perl, or an editor, or a DCL loop.

Now on the VMS side of the house such a file is easy enough to create, but it may be harder to 'recognize' it. Because when typed, with will LOOK like 3 records, but there are just 2.
I'm curious as to who/what the consumer of the file might be?!

Example:

$ crlf = f$fao("!/")
$ create/fdl=nl: test.tmp ! FDL is optional really, all defaults applied
$ open/write test test.tmp
$ write test "EUROPA",crlf,"AFRICA"
$ write test "AMERICA"
$ close test
$ type test.tmp
EUROPA
AFRICA
AMERICA
$ dump /record test.tmp

Record number 1 (00000001), 14 (000E) bytes, RFA(0001,0000,0000)

4143 49524641 0A0D4150 4F525545 EUROPA..AFRICA.................. 000000

Record number 2 (00000002), 7 (0007) bytes, RFA(0001,0000,0012)
414349 52454D41 AMERICA......................... 000000



Enjoy,
Hein
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

May be question is wrong...
Question is that how the magic that RMS keeps only one line displaying as CR LF FF(not executing)
Because if a get this incoming message file from alpha-vms if i put it ascii then executing CR LF FF and it is not same with original
if i put it binary then REAL END OF RECORDS destroyed :)
Steven Schweda
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

> What are the bytes in the original file?
> What defines an EOL in that file?

Still a mystery to me.

> [...] what you would like to see on
> the VMS side.

Also not yet clear.

> MESSAGE1(it contains CR, LF, FF s and it
> seems as "CR" "LF" "FF")

I don't understand this. DUMP /BYTE
[/RECORD] could be more helpful.

> After i transfer my file i must see it as 3
> record LIKE

_You_ must see it, or _FASTWIRE_ must see it
that way? What FASTWIRE sees can depend on
the file's record format and on how the
program opens the file.
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

OK.
Let me say that there is a file on VMS created by VMS utilities.
After I login to system i wrote
EDIT filename
I saw that
HEADER
MESSAGE
TRAILER
There is 3 line.
Second line i.e. the payment message details
shown like that ABCDcrEFGHlfJKLMffNOPRSYT
so it is the fact and this is the RMS file.
So i want to transfer my file to VMS system
in the same display.
But when i transfer i need any other character to put END OF LINE to separate line 2 from line 1...
Steven Schweda
Honored Contributor
Solution

Re: FTP from DOS to Alpha VMS a File Containing CRLF

> so it is the fact and this is the RMS file.

Ok. DIRE /FULL. What is the "Record format"
of your file?

I can't say yet, but it's possible that the
FTP server (or client) can not create a file
with that record format.

> So i want to transfer my file to VMS system

Ok. If you can get all the bytes in your
file on the Windows system to agree with the
bytes in the the good file on the VMS system,
then you should be able to do a binary FTP
transfer, and then set the file attributes
(like record format) to what you need on the
VMS system.

> VMS version?

Still a mystery to me. Recent versions let
you SET FILE /ATTRIBUTES. On older versions,
it's harder, but still possible.

DUMP /BYTE (without /RECORD) will show you
all the actual bytes on the VMS side.
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

>What is the "Record format"
Sequential

>If you can get all the bytes in your
file on the Windows system to agree with the
bytes in the the good file on the VMS system,
then you should be able to do a binary FTP
transfer, and then set the file attributes
(like record format) to what you need on the
VMS system.

When i get this file to PC binary i saw first line and second line has no char between them(HEADERMESSAGE)

When i get this file to PC ascii i saw first lineLFsecond line...
(HEADER
ABCD
EFGH
JKLM)


> VMS version?
OpenVMS Alpha 7.0 ds-15


>DUMP /BYTE (without /RECORD) will show you
all the actual bytes on the VMS side.
Hmm OK Steven let me send you original file's DUMP(created by VMS system)
Steven Schweda
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

> >What is the "Record format"
> Sequential

Look again.

Copy+paste the DIRE /FULL output?

> When i get this file to PC binary [...]

That's binary FTP?

> [...] i saw [...]

You "saw" _how_? If you want to see the
control characters, then you really should
use some kind of dump program, not a text
processing program (to which the control
characters have special meanings).

And I thought that the idea was to move a
file from the Windows system to the VMS
system. I don't think that I care what
happens to a file going the other way. Do
you?
Robert Gezelter
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Ataikili,

First, welcome to the ITRC OpenVMS Forum!

Reading this thread, I think that there may be a misunderstanding.

- Where is the original file (Windows or OpenVMS)?
- What commands are used to FTP the file (and where is the FTP running, OpenVMS or Windows)?

Transferring files with embedded control characters between systems can pose challenges. CR LF FF are used as line/record terminators in some situations, and in the case of RMS, there is support for counted records [the most common] as well as the stream formats.

FTP between Windows and OpenVMS has two modes: BINARY and ASCII. ASCII interprets the control characters in the stream (per the RFC) and BINARY does nothing. Unfortunately, what would appear to be here is possible doing both, which would not be supported by FTP.

If one has to create a file on Windows that includes file control characters in the stream, and is otherwise a standard RMS file using character counts to delimit records, it would (theoretically be possible to do so, but it would be complicated).

A far better solution is to use a plain text format file on the PC for editing, and process it after arrival on OpenVMS into the file with embedded control characters. A DCL command file can read the original file and produce the file with the embedded control characters in a few lines of code.

- Bob Gezelter, http://www.rlgsc.com
Steven Schweda
Honored Contributor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

> - Where is the original file (Windows or
> OpenVMS)?

As I understood things, it all works with
files created (somehow) on a VMS system, but
the desire was to create a file on the
Windows system, use FTP to transfer it to the
VMS system, and have an equivalent (working)
file on the VMS system.

> - What commands are used to FTP the file

Other than ASCII-binary, does it matter?

> (and where is the FTP running, OpenVMS or
> Windows)?

I assume that the FTP client is on the
Windows system, and the FTP server is on VMS.
Again, does it matter?

> [...] Unfortunately, what would appear to
> be here is possible doing both, which would
> not be supported by FTP.

Huh?

> [...] but it would be complicated).

That rather depends on how the source file is
being created on the Windows system. It's
probably hard using Notepad, but writing a
two-byte byte count at the beginning of every
"line" from a C program would be pretty easy,
I should think. (I could do it, so it must
be pretty easy.) Getting the SET FILE
/ATTRIBUTES command run on the VMS system
after the binary FTP transfer would seem to
me to be more complicated than putting out
the bytes for a "Record format: Variable
length, [...]" file on a non-VMS system.

> A far better solution [...]

Well, another possible solution, perhaps. As
usual, many things are possible.
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Hmm, Mr. Gezelter i think you clarify this beginner's problem best


>Where is the original file (Windows or OpenVMS)?
>>in OpenVMS

>What commands are used to FTP the file (and where is the FTP running, OpenVMS or Windows)?
>>ftp 192...
cd ...
asc
put myfile
Ftp running on Windows(BUT if you propose me to start it from vms , if there is special functions sure i can)


>Transferring files with embedded control characters between systems can pose challenges. CR LF FF are used as line/record terminators in some situations, and in the case of RMS, there is support for counted records [the most common] as well as the stream formats.
>>Hmm counted records... it turn me down:(



>FTP between Windows and OpenVMS has two modes: BINARY and ASCII. ASCII interprets the control characters in the stream (per the RFC) and BINARY does nothing. Unfortunately, what would appear to be here is possible doing both, which would not be supported by FTP.
If one has to create a file on Windows that includes file control characters in the stream, and is otherwise a standard RMS file using character counts to delimit records, it would (theoretically be possible to do so, but it would be complicated).
A far better solution is to use a plain text format file on the PC for editing, and process it after arrival on OpenVMS into the file with embedded control characters. A DCL command file can read the original file and produce the file with the embedded control characters in a few lines of code.
>>Then i must prepare a dcl script(it is not need any compilation i think). i read a record and write it to another...

>>OK I will send you DUMP of original RMS file that is created by VMS.
Let me summarize my question shortly again
I only want to create a file in PC side that has the same format with this original one.

Thanks for your help
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Mr. Schweda and Heuvel

Tomorrow morning For original VMS RMS file(created on VMS side)
i will attach DIRE /FULL originalfile output here
i will attach DUMP/BYTE originalfile output here
i will attach DUMP/RECORD originalfile output here
i will wrote VMS version

I have now a few dump program on my PC(xvi32,HexFrame,hworks32)

I will be ready tomorrow morning at console of Alpha VMS Server...

Best wishes see you all
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Hi all again,
pls see the attached file here containing DIRE/FULL DUMP/BLOCK and DUMP/BYTE
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

OpenVms Alpha Operating System v7.3-2
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

ı thinh that is enough to describe the original rms file.
Now how can i create a file like that
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

Mr. Hein
Your example ;

$ crlf = f$fao("!/")
$ create/fdl=nl: test.tmp ! FDL is optional really, all defaults applied
$ open/write test test.tmp
$ write test "EUROPA",crlf,"AFRICA"
$ write test "AMERICA"
$ close test
$ type test.tmp
EUROPA
AFRICA
AMERICA

shows(with EDIT) the file exactly what i need.
And i ned that can you modify your dcl script
according to that
i read the file to end of it and wrote it to a new one
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

AND Record format for test.tmp shown VCF but original rms file's is variable lenght.
it is not a problem i think isnt it ?
Ataikili
Frequent Advisor

Re: FTP from DOS to Alpha VMS a File Containing CRLF

I cant find a solution !!!