- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Record Terminator
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 09:21 AM
06-03-2004 09:21 AM
I converted OpenVMS flat file to HPUX flat file using Vbackup. But When I read converted files, I can't find record terminator.(It looks like one record.) How can I see record terminator after conversion.
Henry
Below is replied e-mail from BBC.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is not that Vbackup did not put the record terminator into the file but rather because on VMS there might not have been a record terminator that UNIX will recognize. On some files in OpenVMS, for example, the record begins with a 4 digit number that indicates how long the record is. Extracted to a UNIX system this would look like a single record.
Adding characters to a file to indicate the end of a record is not always what people need. Without the options set Vbackup does not modify the data being restored.
To make some files useable on UNIX, there has to be some additional conversion. Vbackup cannot know, for example, what the fields in a record should be. That would have to be done after the data is extracted.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 05:06 PM
06-03-2004 05:06 PM
Re: Record Terminator
I don't know what Vbackup is. However, under OpenVMS "flat file" doesn't really mean much. What was the exact record format? Stream? Variable? VFC?
You may need to CONVERT the file to a more Unix friendly format before moving it to HP-UX. Exactly what format depends on what record terminator you want to see.
The e-mail you quote says much the same thing. One GUESS as to what you may want to do:
$ CONVERT/FDL=SYS$INPUT flatfile.dat unix.dat
RECORD
FORMAT STREAM_LF
^Z
This will remove any variable length record or VFC metadata and insert an LF character as the record terminator (or course, if your data also includes LF characters you might have a problem).
Now run your Vbackup on unix.dat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 05:39 PM
06-03-2004 05:39 PM
Re: Record Terminator
Depending on the size of the files and the
connectivity between the systems you might
want to try C-Kermit, which tends to handle
"flat file" transfers between different
architectures.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 05:48 PM
06-03-2004 05:48 PM
Re: Record Terminator
Just had another thought -- have you tried using
ZIP (without saving the VMS attributes) then
using "unzip -aa" to force the extraction to
treat all files as text?
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 05:51 PM
06-03-2004 05:51 PM
Re: Record Terminator
John basically said it all, I just want to add a couple of comments. Unlike Windows and UNIX file systems which (afaik) always treat the contents of a file as a stream of records divided by record terminators (usually
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 08:35 PM
06-03-2004 08:35 PM
Re: Record Terminator
Sounds like Vbackup is a tool on HP-UX.
Most readers here will not be able to judge whether this is the right or wrong tool.
Please provide use with quick pointer to the tool spec IF you are convinced this is the rigth solution.
More likely you were already 'too late'.
The 'damage' / confusion was probably introduced during the transfer and no tool on hpux can fix it afer the fact (unless your data has recognizeable record markers or a predictable (fixed) length.
FTP -- TEXT (ASCI) mode is the easiest 'conversion' during the transfer.
CHeck out the earlier replies on how to prepare a file on VMS (stream_lf) before the transfer if needed.
If none of the above replies help, then you'll have to communicate better what problem your are trying to solve.
What does the input look like (DIR/FULL? ANAL/RMS? DUMP/BLOC=COUN=1 ?)
What should the output on jUX look like? (od -x ?)
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2004 02:35 AM
06-04-2004 02:35 AM
Re: Record Terminator
typing DIR/FULL you can see file type. The unique flat file is fixed that's is treated as binary.
All other file type are not supported by other OS.
Text file could be easly converted but VFC or variable len file need conversion in VMS environment than may be exported to other OS.
Because conversion analyze is too complex you could post original file type for furthermore help.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2004 04:04 AM
06-04-2004 04:04 AM
Re: Record Terminator
Is there any solution after restoring tape to HPUX ?
Thank you for your quick replies.
Henry
Below is Vbackup homepage.
~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.bosbc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2004 04:41 AM
06-04-2004 04:41 AM
Re: Record Terminator
I've looked into bosbc web site and it seems vbackup keeps file attributes.
Because you post vi error line too long, I guess you will edit some text files.
I think you wil try edit some VFC file instead text file. VFC and/or var record files in vms have a byte counter at begin of line and may does't exits end of line.
I hope follows example can help you to understand:
TEXT FILE (MSDOS AND VMS)
|M|Y|L|I|N|E|\r|\n| Text followed by CR (13) and LF (10)
TEXT FILE (UNIX)
|M|Y|L|I|N|E|\n| Text followed by LF (10) called NL in unix
VAR RECORD FILE WITHOUT TERMINATOR (ONLY VMS)
|06|M|Y|L|I|N|E| ASCII 6 to set record len
When you use vi in unix, in 1.st case you read text with \r and end of line; in 2.nd case you read fine; in 3.th case you receive line too long error because vi doesn't find newline (LF).
In unix there is a hex dump utility: you can use this command to view inside file and you can understand what's happening.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2004 11:38 AM
06-06-2004 11:38 AM
Re: Record Terminator
from all the information I've found on the internet there is no indication that Vbackup does handle VFC files well. Your best bet is to get access to a VMS system, read your files there and rely on ftp and/or zip to do the "right" thing as far as record terminators are concerned.
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 12:20 AM
06-07-2004 12:20 AM
Re: Record Terminator
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 01:27 AM
06-07-2004 01:27 AM
Re: Record Terminator
My explicit for others implied request stands: What does the file actually look like on Unix? Just give us an 'od' HEX and/or ASCII dump for the first 1000 bytes or so in a TEXT file attached to your next reply here.
If the file you are opening is a 'plain' VMS text file, then it is VARIABLE LENGTH. That means each record is preceeded by a 16 bit binary length (NOT an 4-digit number, those are only used on Magtape) and starts at an even byte offset in the file. You can read such a file on NT or Unix with a perl script like:
binmode STDIN;
while (read STDIN,$length_word,2) {
# avoid using "S" or "V". just do the math.
($length,$null) = unpack ("CC",$length_word);
$length += $null*256;
last if ($length > 32767);
$read = read STDIN,$line,$length;
print "$line\n";
read STDIN,$null,1 if ($length & 1);
}
Now if the file you are looking for is a cobol report or DCL log file it my be this VFC others alluded to. In that case it gets much more tricky to interpret it. But as a first cut you could modify my program above to skip the first 2 bytes in the record (the ones following the 2 length bytes). That way you will get the raw data, but you will loose the formatting (double-space, over-punch, new-page)
So try that perl, and output a dump if you have no success.
Good luck,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 05:48 AM
06-07-2004 05:48 AM
Re: Record Terminator
I executed "od -x" and I attached output file. Actually, I don't know about perl.
Please give me more detail information about perl command.
Thank you.
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 08:48 AM
06-07-2004 08:48 AM
SolutionThose shell/DCL scripts that spend 90% of their code shuffling bits of string around amidst a few serious command executions (not countingn search/grep/awk/cut as serious) are proabably better in perl (or even awk).
The converse is also true: those perl programs executing 'system' every other line should perhaps haver remained a shell/dcl script.
Anyway... judging by the data of your file you are looking at a 'fixed length record file' probably with record size 120 (dec) bytes. Indeed, on VMS, there are no terminators in such file as they serve no purpose. VMS applications, through RMS, just get the data delivered in 120 bytes chunks.
Now if you move to a lower level OS ( ;-), you'll have to do that yourself. Just like VMS comes with an indexed/keyed records access method and no Unix has that build in.
Ooops, I'm getting further of topic :-)
Back to the script. Create a file 'split.pl' with the contents:
$length = 120;
binmode STDIN;
while (read STDIN,$line,$length) {
print "$line\n";
}
Now:
perl split.pl < vms.data > unix.text
That should do it (but I did not test)
You can also do 'one-liners' like:
perl -e 'binmode STDIN; print "$_\n" while (read STDIN,$_,120)' < vms.data > unix.text
Finally... one has to wonder that the heck you are doing trying to 'vi' a file for which you are so clueless about its contents.
IMHO you should have known it was fixed length, and have a pretty good idea about the record size and the fields within the records when you start poking at this file, based on application knowledge. That stuff has nothing to do with this being Unix or VMS.
Hope my script works well enough to get you looking in the right direction!
Good luck,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 09:17 AM
06-07-2004 09:17 AM
Re: Record Terminator
Thank you for your detail information.
I executed perl script with vms file but I met Error message.
Please check below error.
Thank you.
Henry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
syntax error in file a.pl at line 4, next 2 tokens "read STDIN"
Execution of a.pl aborted due to compilation errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2004 09:38 AM
06-07-2004 09:38 AM
Re: Record Terminator
Try the one-liner also.
You'll figure it out. I know you will...
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 03:18 PM
06-08-2004 03:18 PM
Re: Record Terminator
tested Hein's suggestion on Unix. The code works fine. One thing to check, your error is on line 4, while the stuff it talks about is in Hein's example on line 3. Have you changed the program maybe? How do you execute it?
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2004 06:04 AM
06-09-2004 06:04 AM
Re: Record Terminator
I tried several times but It's not working.
So I changed one thing and I think It's working now !! Thank you very much Hein.:)
Please check below and let me know if this is not good.
Regards,
Henry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# script
$length = 120;
binmode STDIN;
while ( read (STDIN,$line,$length) )
{ print "$line\n"; }
$perl split.pl < vms.data > unix.text
# command line
$perl -e 'binmode STDIN; print "$_\n" while read (STDIN,$_,120)' < vms.data > unix.text
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2004 07:31 AM
07-14-2004 07:31 AM
Re: Record Terminator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2004 02:31 PM
07-14-2004 02:31 PM
Re: Record Terminator
FTP is an option if you still have your VMS system around. But if that is the case there are plenty of ways to deal with this. My reading of Henry's question was that he does not have this luxury and has to find a way to get data out of VMS backup savesets on Unix only.
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2004 09:39 AM
07-15-2004 09:39 AM
Re: Record Terminator
I must have missed that. I also missed the remark of Hein in the 5th reply about FTP. I have to start reading more careful I think :-)
regards, Peter