How to retreive values from a file - VMS

This is a discussion on How to retreive values from a file - VMS ; Hi I have a files.lis file which includes a list of files in a dir. Bro files.lis ALPHA:[Data]file1.ZIP;1 ALPHA:[Data]file2.ZIP;1 ALPHA:[Data]file3.ZIP;1 ALPHA:[Data]file4.ZIP;1 ALPHA:[Data]file5.ZIP;1 ALPHA:[Data]file6.ZIP;1 ALPHA:[Data]file7.ZIP;1 ALPHA:[Data]file8.ZIP;1 ALPHA:[Data]file9.ZIP;1 ALPHA:[Data]file10.ZIP;1 ALPHA:[Data]file11.ZIP;1 ALPHA:[Data]file12.ZIP;1 I am looking for a script to extract file*.zip from File.lis ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: How to retreive values from a file

  1. How to retreive values from a file

    Hi
    I have a files.lis file which includes a list of files in a dir.

    Bro files.lis
    ALPHA:[Data]file1.ZIP;1
    ALPHA:[Data]file2.ZIP;1
    ALPHA:[Data]file3.ZIP;1
    ALPHA:[Data]file4.ZIP;1
    ALPHA:[Data]file5.ZIP;1
    ALPHA:[Data]file6.ZIP;1
    ALPHA:[Data]file7.ZIP;1
    ALPHA:[Data]file8.ZIP;1
    ALPHA:[Data]file9.ZIP;1
    ALPHA:[Data]file10.ZIP;1
    ALPHA:[Data]file11.ZIP;1
    ALPHA:[Data]file12.ZIP;1

    I am looking for a script to extract file*.zip from File.lis and use
    that to check file sizes.

    Does any one have recommendations on how that can be accomplished.

    Aj

  2. Re: How to retreive values from a file

    ajmiester@gmail.com wrote:
    > Hi
    > I have a files.lis file which includes a list of files in a dir.
    >
    > Bro files.lis
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1
    > ALPHA:[Data]file3.ZIP;1
    > ALPHA:[Data]file4.ZIP;1
    > ALPHA:[Data]file5.ZIP;1
    > ALPHA:[Data]file6.ZIP;1
    > ALPHA:[Data]file7.ZIP;1
    > ALPHA:[Data]file8.ZIP;1
    > ALPHA:[Data]file9.ZIP;1
    > ALPHA:[Data]file10.ZIP;1
    > ALPHA:[Data]file11.ZIP;1
    > ALPHA:[Data]file12.ZIP;1
    >
    > I am looking for a script to extract file*.zip from File.lis and use
    > that to check file sizes.
    >
    > Does any one have recommendations on how that can be accomplished.
    >
    > Aj


    Write a short DCL program.
    It's hard for anyone else to do that for you,
    since it unclear what "check file sizes" actualy is.


  3. Re: How to retreive values from a file

    ajmiester@gmail.com wrote:
    > Hi
    > I have a files.lis file which includes a list of files in a dir.
    >
    > Bro files.lis
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1
    > ALPHA:[Data]file3.ZIP;1
    > ALPHA:[Data]file4.ZIP;1
    > ALPHA:[Data]file5.ZIP;1
    > ALPHA:[Data]file6.ZIP;1
    > ALPHA:[Data]file7.ZIP;1
    > ALPHA:[Data]file8.ZIP;1
    > ALPHA:[Data]file9.ZIP;1
    > ALPHA:[Data]file10.ZIP;1
    > ALPHA:[Data]file11.ZIP;1
    > ALPHA:[Data]file12.ZIP;1
    >
    > I am looking for a script to extract file*.zip from File.lis and use
    > that to check file sizes.
    >
    > Does any one have recommendations on how that can be accomplished.
    >
    > Aj


    $ DIR /SIZE ALPHA:[Data]file*.ZIP;1

    Of course this assumes that the files are actually named as in the
    example above. If they are not, a very simple script will do the job.
    Something like:
    $ OPEN TESTFILE: FILE.LIS
    $LOOP:
    $ READ TESTFILE: /END=EOF FNAME
    $ DIRE /SIZE=ALL 'FNAME'
    $ GOTO LOOP
    $EOF:
    $ EXIT

    You may add decorations and seaonings to taste!

  4. Re: How to retreive values from a file

    ajmiester@gmail.com wrote:
    > Hi
    > I have a files.lis file which includes a list of files in a dir.
    >
    > Bro files.lis
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1
    > ALPHA:[Data]file3.ZIP;1
    > ALPHA:[Data]file4.ZIP;1
    > ALPHA:[Data]file5.ZIP;1
    > ALPHA:[Data]file6.ZIP;1
    > ALPHA:[Data]file7.ZIP;1
    > ALPHA:[Data]file8.ZIP;1
    > ALPHA:[Data]file9.ZIP;1
    > ALPHA:[Data]file10.ZIP;1
    > ALPHA:[Data]file11.ZIP;1
    > ALPHA:[Data]file12.ZIP;1
    >
    > I am looking for a script to extract file*.zip from File.lis and use
    > that to check file sizes.
    >
    > Does any one have recommendations on how that can be accomplished.


    Yes, but this is programming 101. The kind of thing kids learn in
    middle school. So why should we do it for you?

  5. Re: How to retreive values from a file

    On Sep 17, 5:20 pm, ajmies...@gmail.com wrote:
    > Hi
    > I have a files.lis file which includes a list of files in a dir.
    >
    > Bro files.lis
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1
    > ALPHA:[Data]file3.ZIP;1
    > ALPHA:[Data]file4.ZIP;1
    > ALPHA:[Data]file5.ZIP;1
    > ALPHA:[Data]file6.ZIP;1
    > ALPHA:[Data]file7.ZIP;1
    > ALPHA:[Data]file8.ZIP;1
    > ALPHA:[Data]file9.ZIP;1
    > ALPHA:[Data]file10.ZIP;1
    > ALPHA:[Data]file11.ZIP;1
    > ALPHA:[Data]file12.ZIP;1
    >
    > I am looking for a script to extract file*.zip from File.lis and use
    > that to check file sizes.
    >
    > Does any one have recommendations on how that can be accomplished.
    >
    > Aj


    What is "Bro files.lis"?

    Bro? Shouldn't that be SYS$BRO? :-)

    AEF

  6. Re: How to retreive values from a file

    ajmiester@gmail.com wrote:
    > Hi
    > I have a files.lis file which includes a list of files in a dir.


    > I am looking for a script to extract file*.zip from File.lis and use
    > that to check file sizes.


    HELP OPEN
    HELP READ
    HELP CLOSE

    This gets you to a DCL script that reads the file line by line, the
    contents going into a symbol.

    Then:

    HELP LEXICAL F$FILE_ATTRIBUTES will tell you how you can get the file
    size when you supply it with a file name. (and lots more info you can get).

    You may also be interested in F$SEARCH("file*.zip") which will do the
    equivalent of a directory function for you, giving you file by file, and
    once it has matched all files, it gives you an empty symbol.

    F$SEARCH is HELP LEXICAL F$SEARCH

  7. Re: How to retreive values from a file

    On Sep 17, 4:20*pm, ajmies...@gmail.com wrote:
    > Hi
    > * I have a files.lis file which includes a list of files in a dir.


    What a 'waste'/encumbrance to put it in a file.
    DCL's F$SEARCH will gladly find just the right files for you.

    files.lis
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1


    > I am looking for a script to extract file*.zip from File.lis


    So that's all of them, or might there be other file in the list?

    Or are you seeking to look INTO the zip files and size up teh
    contents?

    > and use that to check file sizes.


    How do you want to do the 'check'?
    What data is available to check against?
    That every much will define the 'right' tool for the job.

    > Does any one have recommendations on how that can be accomplished.


    1) get more clear instructions.
    2) Write a program to accomplish those instructions
    3) Run the program (or script, or ...)

    Richard already showed a basic DCL loop to get going.

    Here is a perl variant:

    Let's create a list of files:
    $ dir/nohead/notrail sys$system:set*.exe/out=files.tmp
    Now list the sizes of the files in that list:
    $ perl -lne "chomp; printf qq(%9d %s\n), -s $_, $_" files.tmp
    386560 SYS$COMMON:[SYSEXE]SET.EXE;1
    56832 SYS$COMMON:[SYSEXE]SETAUDIT.EXE;1
    :

    Now filter for files with a sub-pattern "hos".
    $ perl -ne "chomp; printf (qq(%9d %s\n), -s $_, $_) if /hos/i"
    files.tmp
    72192 SYS$COMMON:[SYSEXE]SETSHOSECUR.EXE;1
    66560 SYS$COMMON:[SYSEXE]SETSHOSERVER.EXE;1
    315392 SYS$COMMON:[SYSEXE]SETSHOSHADOW.EXE;1

    And now, look ma no hands....

    $ perl -e "for () { printf qq(%9d %s\n), -s
    $_, $_ }"
    72192 sys$common:[sysexe]setshosecur.exe
    66560 sys$common:[sysexe]setshoserver.exe
    315392 sys$common:[sysexe]setshoshadow.exe

    Hein.

  8. Re: How to retreive values from a file

    Also HELP LEXICALS F$FILE, probably
    And try
    $ WRITE SYS$OUTPUT "something"

    If you know programming, you can do it, now

    Syltrem

    "JF Mezei" wrote in message
    news:48d1b283$0$12380$c3e8da3@news.astraweb.com...
    > ajmiester@gmail.com wrote:
    >> Hi
    >> I have a files.lis file which includes a list of files in a dir.

    >
    >> I am looking for a script to extract file*.zip from File.lis and use
    >> that to check file sizes.

    >
    > HELP OPEN
    > HELP READ
    > HELP CLOSE
    >
    > This gets you to a DCL script that reads the file line by line, the
    > contents going into a symbol.
    >
    > Then:
    >
    > HELP LEXICAL F$FILE_ATTRIBUTES will tell you how you can get the file
    > size when you supply it with a file name. (and lots more info you can
    > get).
    >
    > You may also be interested in F$SEARCH("file*.zip") which will do the
    > equivalent of a directory function for you, giving you file by file, and
    > once it has matched all files, it gives you an empty symbol.
    >
    > F$SEARCH is HELP LEXICAL F$SEARCH




  9. Re: How to retreive values from a file

    On Sep 18, 9:15*am, "Syltrem" wrote:
    > Also HELP LEXICALS F$FILE, probably
    > And try
    > $ WRITE SYS$OUTPUT "something"
    >
    > If you know programming, you can do it, now
    >
    > Syltrem
    >
    > "JF Mezei" wrote in message
    >
    > news:48d1b283$0$12380$c3e8da3@news.astraweb.com...
    >
    >
    >
    > > ajmies...@gmail.com wrote:
    > >> Hi
    > >> * I have a files.lis file which includes a list of files in a dir.

    >
    > >> I am looking for a script to extract file*.zip from File.lis and use
    > >> that to check file sizes.

    >
    > > HELP OPEN
    > > HELP READ
    > > HELP CLOSE

    >
    > > This gets you to a DCL script that reads the file line by line, the
    > > contents going into a symbol.

    >
    > > Then:

    >
    > > HELP LEXICAL F$FILE_ATTRIBUTES *will tell you how you can get the file
    > > size when you supply it with a file name. (and lots more info you can
    > > get).

    >
    > > You may also be interested in F$SEARCH("file*.zip") which will do the
    > > equivalent of a directory function for you, giving you file by file, and
    > > once it has matched all files, it gives you an empty symbol.

    >
    > > F$SEARCH is HELP LEXICAL F$SEARCH- Hide quoted text -

    >
    > - Show quoted text -


    Thank you for all your resonses. I should have been more specific

    Bro files.lis --> Files.lis is a list file which includes
    information for the list of zips files in a partricular location. Bro
    is the browse command to view records in the file.lis file

    ALPHA:[Data]file1.ZIP;1
    ALPHA:[Data]file2.ZIP;1
    ALPHA:[Data]file3.ZIP;1
    ALPHA:[Data]file4.ZIP;1
    ALPHA:[Data]file5.ZIP;1
    ALPHA:[Data]file6.ZIP;1
    ALPHA:[Data]file7.ZIP;1
    ALPHA:[Data]file8.ZIP;1
    ALPHA:[Data]file9.ZIP;1
    ALPHA:[Data]file10.ZIP;1
    ALPHA:[Data]file11.ZIP;1
    ALPHA:[Data]file12.ZIP;1

    I am checking if zip files are not empty and then checking files
    uncompressed from the zip. The filenames are same, the only difference
    is the extension. Therefore I am trying to extract the filenames
    without the zip extension from the Files.lis file

    I am new to DCL prog and tried the following

    $ chkname=(search FILES.LIS zip) ---> extracts files with zip
    extensions
    $ show symbol chkname
    $ filetype1=f$extract(16,45,"chkname") ---> extracts files without
    the extensions
    $ show symbol filetype1

    But it isnt giviing me the result I am looking for
    Aj

  10. Re: How to retreive values from a file

    ajmiester@gmail.com wrote:
    > On Sep 18, 9:15 am, "Syltrem" wrote:
    >> Also HELP LEXICALS F$FILE, probably
    >> And try
    >> $ WRITE SYS$OUTPUT "something"
    >>
    >> If you know programming, you can do it, now
    >>
    >> Syltrem
    >>
    >> "JF Mezei" wrote in message
    >>
    >> news:48d1b283$0$12380$c3e8da3@news.astraweb.com...
    >>
    >>
    >>
    >>> ajmies...@gmail.com wrote:
    >>>> Hi
    >>>> I have a files.lis file which includes a list of files in a dir.
    >>>> I am looking for a script to extract file*.zip from File.lis and use
    >>>> that to check file sizes.
    >>> HELP OPEN
    >>> HELP READ
    >>> HELP CLOSE
    >>> This gets you to a DCL script that reads the file line by line, the
    >>> contents going into a symbol.
    >>> Then:
    >>> HELP LEXICAL F$FILE_ATTRIBUTES will tell you how you can get the file
    >>> size when you supply it with a file name. (and lots more info you can
    >>> get).
    >>> You may also be interested in F$SEARCH("file*.zip") which will do the
    >>> equivalent of a directory function for you, giving you file by file, and
    >>> once it has matched all files, it gives you an empty symbol.
    >>> F$SEARCH is HELP LEXICAL F$SEARCH- Hide quoted text -

    >> - Show quoted text -

    >
    > Thank you for all your resonses. I should have been more specific
    >
    > Bro files.lis --> Files.lis is a list file which includes
    > information for the list of zips files in a partricular location. Bro
    > is the browse command to view records in the file.lis file
    >
    > ALPHA:[Data]file1.ZIP;1
    > ALPHA:[Data]file2.ZIP;1
    > ALPHA:[Data]file3.ZIP;1
    > ALPHA:[Data]file4.ZIP;1
    > ALPHA:[Data]file5.ZIP;1
    > ALPHA:[Data]file6.ZIP;1
    > ALPHA:[Data]file7.ZIP;1
    > ALPHA:[Data]file8.ZIP;1
    > ALPHA:[Data]file9.ZIP;1
    > ALPHA:[Data]file10.ZIP;1
    > ALPHA:[Data]file11.ZIP;1
    > ALPHA:[Data]file12.ZIP;1
    >
    > I am checking if zip files are not empty and then checking files
    > uncompressed from the zip. The filenames are same, the only difference
    > is the extension. Therefore I am trying to extract the filenames
    > without the zip extension from the Files.lis file
    >
    > I am new to DCL prog and tried the following
    >
    > $ chkname=(search FILES.LIS zip) ---> extracts files with zip
    > extensions
    > $ show symbol chkname
    > $ filetype1=f$extract(16,45,"chkname") ---> extracts files without
    > the extensions
    > $ show symbol filetype1
    >
    > But it isnt giviing me the result I am looking for
    > Aj


    $ HELP LEXICAL F$PARSE

  11. Re: How to retreive values from a file

    On Sep 18, 1:04*pm, "Richard B. Gilbert"
    wrote:
    > ajmies...@gmail.com wrote:
    > > On Sep 18, 9:15 am, "Syltrem" wrote:
    > >> Also HELP LEXICALS F$FILE, probably
    > >> And try
    > >> $ WRITE SYS$OUTPUT "something"

    >
    > >> If you know programming, you can do it, now

    >
    > >> Syltrem

    >
    > >> "JF Mezei" wrote in message

    >
    > >>news:48d1b283$0$12380$c3e8da3@news.astraweb.com...

    >
    > >>> ajmies...@gmail.com wrote:
    > >>>> Hi
    > >>>> * I have a files.lis file which includes a list of files in a dir.
    > >>>> I am looking for a script to extract file*.zip from File.lis and use
    > >>>> that to check file sizes.
    > >>> HELP OPEN
    > >>> HELP READ
    > >>> HELP CLOSE
    > >>> This gets you to a DCL script that reads the file line by line, the
    > >>> contents going into a symbol.
    > >>> Then:
    > >>> HELP LEXICAL F$FILE_ATTRIBUTES *will tell you how you can get the file
    > >>> size when you supply it with a file name. (and lots more info you can
    > >>> get).
    > >>> You may also be interested in F$SEARCH("file*.zip") which will do the
    > >>> equivalent of a directory function for you, giving you file by file, and
    > >>> once it has matched all files, it gives you an empty symbol.
    > >>> F$SEARCH is HELP LEXICAL F$SEARCH- Hide quoted text -
    > >> - Show quoted text -

    >
    > > Thank you for all your resonses. I should have been more specific

    >
    > > Bro files.lis * --> *Files.lis is a list file which includes
    > > information for the list of zips files in a partricular location. Bro
    > > is the browse command to view records in the file.lis file

    >
    > > ALPHA:[Data]file1.ZIP;1
    > > ALPHA:[Data]file2.ZIP;1
    > > ALPHA:[Data]file3.ZIP;1
    > > ALPHA:[Data]file4.ZIP;1
    > > ALPHA:[Data]file5.ZIP;1
    > > ALPHA:[Data]file6.ZIP;1
    > > ALPHA:[Data]file7.ZIP;1
    > > ALPHA:[Data]file8.ZIP;1
    > > ALPHA:[Data]file9.ZIP;1
    > > ALPHA:[Data]file10.ZIP;1
    > > ALPHA:[Data]file11.ZIP;1
    > > ALPHA:[Data]file12.ZIP;1

    >
    > > I am checking if zip files are not empty and then checking files
    > > uncompressed from the zip. The filenames are same, the only difference
    > > is the extension. Therefore I am trying to extract the filenames
    > > without the zip extension from the Files.lis file

    >
    > > I am new to DCL prog and tried the following

    >
    > > $ chkname=(search FILES.LIS zip) ---> extracts files with zip
    > > extensions
    > > $ show symbol chkname
    > > $ filetype1=f$extract(16,45,"chkname") *---> extracts files without
    > > the extensions
    > > $ show symbol filetype1

    >
    > > But it isnt giviing me the result I am looking for
    > > Aj

    >
    > $ HELP LEXICAL F$PARSE- Hide quoted text -
    >
    > - Show quoted text -


    Thanx, that was helpfull

  12. Re: How to retreive values from a file

    HELP is your friend
    VMS uses english terms in all commands so it`s easy to find your way through
    HELP
    Syltrem

    wrote in message
    news:426b8e0e-8165-4ebe-a64a-85d825854a46@g17g2000prg.googlegroups.com...
    On Sep 18, 1:04 pm, "Richard B. Gilbert"
    wrote:
    > ajmies...@gmail.com wrote:
    > > On Sep 18, 9:15 am, "Syltrem" wrote:
    > >> Also HELP LEXICALS F$FILE, probably
    > >> And try
    > >> $ WRITE SYS$OUTPUT "something"

    >
    > >> If you know programming, you can do it, now

    >
    > >> Syltrem

    >
    > >> "JF Mezei" wrote in message

    >
    > >>news:48d1b283$0$12380$c3e8da3@news.astraweb.com...

    >
    > >>> ajmies...@gmail.com wrote:
    > >>>> Hi
    > >>>> I have a files.lis file which includes a list of files in a dir.
    > >>>> I am looking for a script to extract file*.zip from File.lis and use
    > >>>> that to check file sizes.
    > >>> HELP OPEN
    > >>> HELP READ
    > >>> HELP CLOSE
    > >>> This gets you to a DCL script that reads the file line by line, the
    > >>> contents going into a symbol.
    > >>> Then:
    > >>> HELP LEXICAL F$FILE_ATTRIBUTES will tell you how you can get the file
    > >>> size when you supply it with a file name. (and lots more info you can
    > >>> get).
    > >>> You may also be interested in F$SEARCH("file*.zip") which will do the
    > >>> equivalent of a directory function for you, giving you file by file,
    > >>> and
    > >>> once it has matched all files, it gives you an empty symbol.
    > >>> F$SEARCH is HELP LEXICAL F$SEARCH- Hide quoted text -
    > >> - Show quoted text -

    >
    > > Thank you for all your resonses. I should have been more specific

    >
    > > Bro files.lis --> Files.lis is a list file which includes
    > > information for the list of zips files in a partricular location. Bro
    > > is the browse command to view records in the file.lis file

    >
    > > ALPHA:[Data]file1.ZIP;1
    > > ALPHA:[Data]file2.ZIP;1
    > > ALPHA:[Data]file3.ZIP;1
    > > ALPHA:[Data]file4.ZIP;1
    > > ALPHA:[Data]file5.ZIP;1
    > > ALPHA:[Data]file6.ZIP;1
    > > ALPHA:[Data]file7.ZIP;1
    > > ALPHA:[Data]file8.ZIP;1
    > > ALPHA:[Data]file9.ZIP;1
    > > ALPHA:[Data]file10.ZIP;1
    > > ALPHA:[Data]file11.ZIP;1
    > > ALPHA:[Data]file12.ZIP;1

    >
    > > I am checking if zip files are not empty and then checking files
    > > uncompressed from the zip. The filenames are same, the only difference
    > > is the extension. Therefore I am trying to extract the filenames
    > > without the zip extension from the Files.lis file

    >
    > > I am new to DCL prog and tried the following

    >
    > > $ chkname=(search FILES.LIS zip) ---> extracts files with zip
    > > extensions
    > > $ show symbol chkname
    > > $ filetype1=f$extract(16,45,"chkname") ---> extracts files without
    > > the extensions
    > > $ show symbol filetype1

    >
    > > But it isnt giviing me the result I am looking for
    > > Aj

    >
    > $ HELP LEXICAL F$PARSE- Hide quoted text -
    >
    > - Show quoted text -


    Thanx, that was helpfull



+ Reply to Thread