Operating System - OpenVMS
1752590 Members
3618 Online
108788 Solutions
New Discussion юеВ

how can i read a sequential rms file and write it to a sequential variable lenght rms file

 
SOLVED
Go to solution
Ataikili
Frequent Advisor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Pinkley i think you can't understand the question.
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...
Hein van den Heuvel
Honored Contributor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

>> here what is p2 and 'p2
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.
Hein van den Heuvel
Honored Contributor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Ataikili,

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.

Ataikili
Frequent Advisor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Hi Heuvel,
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 :)
Steven Schweda
Honored Contributor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

> Today i asked 5-6 question(some of them
> 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.
Ataikili
Frequent Advisor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Mr. Schweda
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
Ataikili
Frequent Advisor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Hein , Wim
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
Phil.Howell
Honored Contributor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

what didn't work when you tried the zip, ftp, unzip method?
Ataikili
Frequent Advisor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

Hi Phil,
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
Wim Van den Wyngaert
Honored Contributor

Re: how can i read a sequential rms file and write it to a sequential variable lenght rms file

cr[0,7]=13
lf[0,7]=10
rec = rec - cr -lf (may be in a loop until all cr gone)

Wim
Wim