- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: how can i read a sequential rms file and write...
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
08-18-2008 05:37 AM
08-18-2008 05:37 AM
Hein's offer a dcl script that can put CRLF inside file and this is first step for me.
$ 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
this creates a rms file with record format VCF
i want it sequential variable lenght.
And i want to create it from reading a file(that come from xp-dos with ftp) and write to file(that i want)
I need a dcl that reads a file record by record
until end of file and write to another file.
Who can propose a dcl script for it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 05:42 AM
08-18-2008 05:42 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
open/write
by
open/append
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 05:57 AM
08-18-2008 05:57 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
Anyway... here is what I tried to reply to the FTP topic, but it close, and it seems to apply here:
FTP is going to be a little tricky, because of the cr-lf. On the dos side, and in an ascci file transfer, at the cr-lf is undistinguishable from a new line.
Fortunately the data is well recognizable.
So on the OpenVMS side you could process the ascii text and glue everything together unless it starts with "14-spaces and a tab followed by 6 numbers and a tab". SMOP. Send money and we'll do it :-).
I would look at delivering the file with 'codes' for cr-lf and ff (and tab optionally). The PERL/C style escapes might do (\r \f \t ...) but since this is OpenVMS, why not use the Formatted Ascii Output directives.
Check out: help lexi f$fao directive
For example, the first two lines as generated on Windoze could be:
HA050501390004
A000026 !_020508!_0033848!/0062!_00440!_842!/0139!_99999.999.!/NORM!_12000!_4!_RPS!_N!/TEST!/!/!_TEST!/SEN METAL END.VE SAN.TI
C.LTD.STI!/TR41000139007C0030712BL001!_7350477692!_G!/ALICI TEST!^0139999990033848
(all together, I also used !_ for
Now feed this into a DCL script
----- Formatter.com ----
$if p2.eqs."" then exit
$close/nolog in
$close/nolog out
$open/error=done in 'p1
$create 'p2
$open/append out 'p2
$loop:
$read/end=done in record
$write out f$fao(record)
$goto loop
$done:
$close/nolog in
$close/nolog out
$exit
--------------------
Use as: @formatter.com test.dat test.out
When I do this, the DUMP/RECORD for test.out gives EXACTLY the same bytes you attached in the dump.
Good luck!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 06:00 AM
08-18-2008 06:00 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
What you suggested ?
is it convert my file from VCF to variable lenght record format ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 06:04 AM
08-18-2008 06:04 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
If the 'damge is already done' then you can just convert the DCL generated VFC-PRN file to a 'normal' sequential file using:
$CONVERT/FDL=NL: dcl.txt normal.txt
Yes, that's right. An 'empty' FDL file has all the default to make a normal file.
Enjoy,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 06:14 AM
08-18-2008 06:14 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
So,
create new.dat
open/append x neww.dat
open/read o old.dat
b:
read/end=e o o_rec
write x o_rec
goto b
e:
close x
close o
Not sure what your file contains. Maybe you have to split o_rec.
Wim
BTW : my file transfer from dos to vms gives correct results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 06:54 AM
08-18-2008 06:54 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
so i did tried heins one... it run but do nothing :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 07:00 AM
08-18-2008 07:00 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
$if p2.eqs."" then exit
$close/nolog in
$close/nolog out
$open/error=done in 'p1
$create 'p2
$open/append out 'p2
$loop:
$read/end=done in record
$write out f$fao(record)
...
here what is p2 and 'p2
and is (record) means my record or it is only a keyword ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 07:05 AM
08-18-2008 07:05 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
that is okey but with ' it understand it is a veriable??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 07:31 AM
08-18-2008 07:31 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
so i did tried heins one... it run but do nothing :)"
What exactly did you try? The formatter or the create/fdl=nl:?
The formatter works given the input hein provided (you will have to remove a line wrap from the input file).
Hein's proposal is about as straight forward as you can get. If you can't work with that, you need to hire someone to write the programs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 07:41 AM
08-18-2008 07:41 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
From this code i suppose p1 p2 are the params containing filenames .
Because i can't see filenames inside code but only in run command."@formatter.com fileinp fileoutput".
So i think it can be the variables of filenames.
VMS is only a $ sign for me. Beginner is an expert for me...
I want only 2-3 tricky clues for my question.
You only wasting my time with this comment...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 07:59 AM
08-18-2008 07:59 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
and is (record) means my record or it is only a keyword ?
p1 through p8 are 'automatic' names for command file arguments.
>> Hein p1 param1(input file), p2(ouput file) that is okey but with ' it understand it is a veriable??
You can use typed in text there, or used variable substitutions: 'your-variable-for-filename'
If this is part of a larger script, then I would just embed the core of the code, and not stick it in a seperated command files.
Untested/unfished hint:
$file_loop:
$close/nolog in
$close/nolog out
$inname = f$search("input*.dat")
$if infile.eqs."" then exit
$outname = f$parse(inname,,,"name") + ".out"
$open/error=file_loop in 'inname
$create 'outname
$open/append out 'outname
$record_loop:
$read/end=file_loop in record
$write out f$fao(record)
$goto record_loop
or...
$ i = 0
$file_loop:
$ i = i + 1
$close/nolog in
$close/nolog out
$name = f$fao("batch_!4ZL",i)
$inname = name + ".dat"
$outname = name + ".out"
$open/error=done in 'inname
$create 'outname
$open/append out 'outname
$record_loop:
$read/end=file_loop in record
$write out f$fao(record)
$goto record_loop
$done:
$write "Done. Could not open file: " inname
$exit
Happy learnings,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 10:33 AM
08-18-2008 10:33 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
I think you have send me an Email just now, but it landed in my spam folder, and I hit the permanent delete button before reading.
Please resend if it is something you feel you can not ask here.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 12:22 PM
08-18-2008 12:22 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
I resend it again.
Sure i can ask here but i want speed up the job.
Today i asked 5-6 question(some of them sure not valid questions...) and got 2 valid answer in 8 hours :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 12:37 PM
08-18-2008 12:37 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
> sure not valid questions...) and got 2
> valid answer in 8 hours :)
Better questions might help considerably.
Starting three threads for one problem was
probably not optimal, either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 12:42 PM
08-18-2008 12:42 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
You are absolutely right.
And as i wrote i cant recognise the true question.
As you know i guessed i can find the solution inside ftp and asked first question for ftp :)
and then asked for creating rms...
I have also users for my applications and lots of the questions nonsense:)
So i never think their questions nonsense.if they can ask it better way sure they can solve it...
Thanks for your helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 02:40 PM
08-18-2008 02:40 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
Thanks for your replies.
I understand some of what you means at 01:38 AM :)
But still it seems only a tip of iceberg
Ongoing...
Kindly regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 06:36 PM
08-18-2008 06:36 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 02:53 AM
08-19-2008 02:53 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
Sure i used ftp with optimum mode and create a file. But not absolutely solved my question.
I think i am near my solution now :)
Now i have a sequential file that has variable lenght record format with cr control=carriage control.
Yes everythink is okey last step is;
i want to replace all "qw" strings with CRLF
in my file.
i tried with f$parse, f$string, f$locate
but i cant find true solution.
$ crlf = f$fao("!/")
$.............
pls fill in the blanks :)
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 03:56 AM
08-19-2008 03:56 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
lf[0,7]=10
rec = rec - cr -lf (may be in a loop until all cr gone)
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 03:57 AM
08-19-2008 03:57 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 04:07 AM
08-19-2008 04:07 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
"qw" only a string.
i used it instead of CRLF in my file.
Now i transfer my file with ftp(ascii mode) to vms AND ready to convert "qw" with CRLF.
i cant find any replace function...
As want to strip "qw" and add CRLF to same offset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 04:45 AM
08-19-2008 04:45 AM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
$ pos=f$loc("qw",rec)
$ len=f$len(rec)
$ if pos .lt. len
$ then
$ rec=f$extr(0,pos-1,rec)+ cr + lf + f$extr(pos+2,len-pos-1)
$ goto loop
$ endif
Wim (untested)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 08:10 AM
08-19-2008 08:10 AM
Solution$crlf = F$FAO("!/")
$loop:
$qw = F$LOCATE("qw",record)
$IF qw.EQ.F$LEN(record) THEN GOTO no_more_qw
$record = f$extract(0,qw,record) + crlf + f$extract(qw+2,999,record)
$GOTO loop
$no_more_qw:
Here is an other for the now much simplyfied problem:
Just use a TPU script.
-------------- replace.tpu ----------------
procedure replace_qw_by_crlf
local string_range;
loop;
string_range := search('qw',forward);
exitif string_range = 0;
position(beginning_of(string_range));
erase(string_range);
copy_text(ascii(13));
copy_text(ascii(10));
endloop;
exit;
endprocedure;
replace_qw_by_crlf;
write;
exit;
----------------------------------
$ edit/tpu/nodisplay/command=replace.tpu /out=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 01:45 PM
08-19-2008 01:45 PM
Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file
you want to get a file in a format so FASTWIRE 'eats' it? Well, how does the format of a file written by FASTWIRE look like (DUMP/RECORD)?
Then we can tell you how it may be composed on the Windows side or, how your FTPed file can be transformed on the OpenVMS side.
One thing to keep in mind with OpenVMS file atrributes is that "Record attributes: Carriage return carriage control" means if that file is presented on a terminal or printer an extra CR/LF is output to the device. But this CR/LF IS NOT IN THE FILE!!!
/Guenther