-1

How can I change the file organization attribute in OpenVMS?

I have a file kishore.txt.

The following details are the full description of the file

$ dir/full kishore.txt

KISHORE.TXT;1                 File ID:  (38660,48,0)
Size:            2/16         Owner:    [SYSTEM]
Created:    12-SEP-2012 03:09:29.41
Revised:    12-SEP-2012 03:09:29.43 (1)
Expires:    <None specified>
Backup:     <No backup recorded>
Effective:  <None specified>
Recording:  <None specified>
Accessed:   <None specified>
Attributes: <None specified>
Modified:   <None specified>
Linkcount:  1
File organization:  Sequential
Shelved state:      Online
Caching attribute:  Writethrough
File attributes:    Allocation: 16, Extend: 0, Global buffer count: 0, No version limit
Record format:      Variable length, maximum 0 bytes, longest 69 bytes
Record attributes:  None
RMS attributes:     None
Journaling enabled: None
File protection:    System:RWED, Owner:RWED, Group:RE, World:
Access Cntrl List:  None
Client attributes:  None

Total of 1 file, 2/16 blocks.

I had change the record attributes by using the command

set file/attribute=(RFM:VAR) kishore.txt

The command is successful but the same command for file organization it is not working.

The file organization is currently sequential but my aim is to change the file organization: to 2) relative then 3) indexed.

Viktor S.
  • 12,736
  • 1
  • 27
  • 52
  • You might want to work on the formatting of this question a bit and fix the excessive capitalisation in the title. – Flexo Sep 21 '12 at 06:38
  • Have a look at `analyze/rms_file` to create an FDL file, `edit/fdl` to change the attributes and `convert/fdl` to convert your file. At least that's what they used to be a few major releases ago. – HABO Sep 21 '12 at 12:59
  • Off-topic, yet ... It seems you're using [SYSTEM] account -- for your own safety you may consider operating from a non-privileged user-account. It'll give you more peace-of-mind, while you're climbing OpenVMS learning curve. Sorry, if that's not relevant. – vmsnomad Nov 08 '12 at 22:56

1 Answers1

3

Hmmm, missed this... is it per chance a class exercise? The question does not make much sense!

How can I change the file organization attribute in OpenVMS?

You can not. Period. The file organization is a very permanent attribute. The name says it all... it is the way the (data in the) file is organized.

You can however convert a file with an one organization into an an other file with an other organization. Typically one uses the CONVERT tool for this which read records from the input file and stores them, one at a time, in the output file. The out put file can be pre-created with a some program, or convert can create it for you guided by an FDL file. Google +site:hp.com openvms fdl. Or while on VMS, type $ HELP FDL.

I have a file kishore.txt.

if yo turn that into a relative file, how should the records be numbered. 1 .. N as per source?

If you turn that into an index file, how should the records be keyed? (identified, selected,...). Lets just say that the first 10 bytes in each record of your input file are in fact a (unique?) key. well, then you can create an FDL file describing that. For a full example FDL file check out for example

 $ANALYZE /RMS/FDL/OUT=x.FDL SYS$LIBRARY:VMS$PASSWORD_DICTIONARY.DATA 

In a much abbreviated form you could use:

 $CONV/STAT/FDL="file; org ind; key 0; seg0_l 10" kishore.txt kishore.idx

It makes perhaps little sense... but you could do it to change your sequential input file into an indexed file with a 10 character primary key starting at position 0. Not how this does not change the input file, it just creates an indexed output file with the same date records, possible in a different retrieval order (sorted!).

Cheers, Hein.

Hein
  • 1,453
  • 8
  • 8