Help needed on files 
Author Message
 Help needed on files

Hi,

I am very new to REXX .. I have this task of identifying
all files greater than 42 chars on the IBM mainframe ..
Is there a way of writing a REXX script for this ??

thanks in advance ..

-Vik



Fri, 09 Feb 2001 03:00:00 GMT  
 Help needed on files
Need more information.  First, is this MVS or VM?

What do you mean by "greater than 42 chars"?
a) All files whose filename is > 42 chars?  (probably only applicable on
MVS,
     but could be true if using SFS on VM)
b) All files that contain records whose LRECL is > 42?
c) All files that are larger than 42 bytes?

--
-- Gary Richtmeyer, Tampa, Florida

Quote:

>Hi,

>I am very new to REXX .. I have this task of identifying
>all files greater than 42 chars on the IBM mainframe ..
>Is there a way of writing a REXX script for this ??

>thanks in advance ..

>-Vik



Fri, 09 Feb 2001 03:00:00 GMT  
 Help needed on files

Quote:
>all files greater than 42 chars on the IBM mainframe ..

Assuming you are using TSO and or ISPF you can do something like this:

/* rexx */
x=outtrap(listcat.l.)
"listcat level('a*')"
x=outtrap(off)

do a=1 to listcat.l.0
    parse output
end

return

Assuming you can figure out how to parse the output, this should work fine.
It will chug for a very long time so you may want to run it in batch. Type
TSO HELP LISTCAT to get help on the LISTCAT command and use once without the
REXX to see what the output looks like.

Hope this helps.



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files
Hi Gary ,

It is MVS .. IBM Mainframe ..

let me layout the problem ..
This is for some Y2K analysis .. the file names have the date
in them and they are to be appended with the century.
Now there are some files which will exceed the limit of 42
characters
if we put in this century. For impact analysis i have to isolate
all files which have already the reached the limit of 42 chars.

will be grateful for any help ..
thanks,
Vik

Quote:

> Need more information.  First, is this MVS or VM?

> What do you mean by "greater than 42 chars"?
> a) All files whose filename is > 42 chars?  (probably only applicable on
> MVS,
>      but could be true if using SFS on VM)
> b) All files that contain records whose LRECL is > 42?
> c) All files that are larger than 42 bytes?

> --
> -- Gary Richtmeyer, Tampa, Florida


> >Hi,

> >I am very new to REXX .. I have this task of identifying
> >all files greater than 42 chars on the IBM mainframe ..
> >Is there a way of writing a REXX script for this ??

> >thanks in advance ..

> >-Vik



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files
thanks for the info Jeff ..
well .. how do i parse the output ??
I mean i am looking for file names greater than 42 characters in
length.

thanks in advance ..

-Vik

Quote:

> >all files greater than 42 chars on the IBM mainframe ..

> Assuming you are using TSO and or ISPF you can do something like this:

> /* rexx */
> x=outtrap(listcat.l.)
> "listcat level('a*')"
> x=outtrap(off)

> do a=1 to listcat.l.0
>     parse output
> end

> return

> Assuming you can figure out how to parse the output, this should work fine.
> It will chug for a very long time so you may want to run it in batch. Type
> TSO HELP LISTCAT to get help on the LISTCAT command and use once without the
> REXX to see what the output looks like.

> Hope this helps.



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files
Vikram, you can issue a TSO command within REXX and
have the output stored in an array.  It's done like this:
    temp = OUTTRAP('RECS.')  /* put output in "RECS.x" */
   address TSO "LISTC"             /* do the TSO command */
   temp = OUTTRAP('OFF')        /* turn off trapping */
   do i = 1 to recs.0
      say recs.i     /* show each record */
      end

1) Determine the TSO command you want to enter, e.g.
    LISTC LEVEL('MYID') NAME
2) Note the type of output it creates, e.g.
    NONVSAM ------- MYID.LOG.MISC
         IN-CAT --- VCATICF.TSO0CATA
    NONVSAM ------- MYID.TEST.SEQ
         IN-CAT --- VCATICF.TSO0CATA
3) Parse each record to extract the filename and check it.

Here's an example:
/* */
tsocmd = 'LISTC LEVEL("MYID") NAME'
temp = OUTTRAP('RECS.')
address TSO tsocmd
temp = OUTTRAP('OFF')
do i = 1 to recs.0
  parse var rec.i part1 . filename
  if part1 = 'NONVSAM'
    then if length(filename) > 42
      then say filename '- greater than 42'
  end i
exit

Hope this helps.
--
-- Gary Richtmeyer, Tampa, Florida

Quote:

>Hi Gary ,

>It is MVS .. IBM Mainframe ..

>let me layout the problem ..
>This is for some Y2K analysis .. the file names have the date
>in them and they are to be appended with the century.
>Now there are some files which will exceed the limit of 42
>characters
>if we put in this century. For impact analysis i have to isolate
>all files which have already the reached the limit of 42 chars.

>will be grateful for any help ..
>thanks,
>Vik


>> Need more information.  First, is this MVS or VM?

>> What do you mean by "greater than 42 chars"?
>> a) All files whose filename is > 42 chars?  (probably only applicable on
>> MVS,
>>      but could be true if using SFS on VM)
>> b) All files that contain records whose LRECL is > 42?
>> c) All files that are larger than 42 bytes?

>> --
>> -- Gary Richtmeyer, Tampa, Florida


>> >Hi,

>> >I am very new to REXX .. I have this task of identifying
>> >all files greater than 42 chars on the IBM mainframe ..
>> >Is there a way of writing a REXX script for this ??

>> >thanks in advance ..

>> >-Vik



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files
that was fantastic !! thanks a million ..

-Vik

Quote:

> Vikram, you can issue a TSO command within REXX and
> have the output stored in an array.  It's done like this:
>     temp = OUTTRAP('RECS.')  /* put output in "RECS.x" */
>    address TSO "LISTC"             /* do the TSO command */



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files
What you need to do is get the output from the LISTCAT command into a file
(use EXECIO to read it into a stem variable to use in your routine) or, as
shown in an earlier response as a stem variable in the REXX routine using
OUTTRAP.  You will parse the record/stem looking for NONVSAM, GDG BASE,
CLUSTER, DATA, INDEX, etc. as the first word(s) of the input record/stem to
find the records containing the dataset names. When you have one of these
records then parse the record further to "extract" the dataset name. Once
you have the dataset name you can use the LENGTH function to determine how
long it is and if it is greater than 42 put it to a file or if you run this
in batch you can use the SAY verb to list those datasets exceeding your
limit and the output will go to SYSTSPRT.  It's not that difficult.  You
just need to plan the search criteria to be sure you know which input
records contain dataset names to be analyzed and then parse that record to
extract the name.

Email me directly if you need any clarification on what I was trying to
explain above and I'll try to help if I can.

Duane



Quote:
> Hi Gary ,

> It is MVS .. IBM Mainframe ..

> let me layout the problem ..
> This is for some Y2K analysis .. the file names have the date
> in them and they are to be appended with the century.
> Now there are some files which will exceed the limit of 42
> characters
> if we put in this century. For impact analysis i have to isolate
> all files which have already the reached the limit of 42 chars.

> will be grateful for any help ..
> thanks,
> Vik


> > Need more information.  First, is this MVS or VM?

> > What do you mean by "greater than 42 chars"?
> > a) All files whose filename is > 42 chars?  (probably only applicable
on
> > MVS,
> >      but could be true if using SFS on VM)
> > b) All files that contain records whose LRECL is > 42?
> > c) All files that are larger than 42 bytes?

> > --
> > -- Gary Richtmeyer, Tampa, Florida


> > >Hi,

> > >I am very new to REXX .. I have this task of identifying
> > >all files greater than 42 chars on the IBM mainframe ..
> > >Is there a way of writing a REXX script for this ??

> > >thanks in advance ..

> > >-Vik



Sat, 10 Feb 2001 03:00:00 GMT  
 Help needed on files

Quote:
>well .. how do i parse the output ??
>I mean i am looking for file names greater than 42 characters in
>length.

See the posting by Duane Lee.

What I usually do in these situations, rather than look up the answer, is to
do a limited test run. Say for a specific set of DSN's. Look at the output
and determine what you need to strip off. Look for an indicator on the line
containing the DSN. This indicator should be unique to this line. Parse
these lines with the PARSE statement. Check the DSN lenght and you are done.
If you have an extremely large list of files you will want to feed that list
to a file and run it through a utility such as FileAid or SyncSort to strip
off the info you need and then feed only the DSN's back through REXX to
parse off the DSN's and determine the lenfth of the file name. You may be
able to hack this out with COBOL, but there you are on your own. COBOL would
be faster if compiled, but if you have the time use REXX it will be much
easier to do.



Sun, 11 Feb 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. HELP needed with FILE Structure ...

2. help needed (read file)

3. help needed with file-handling

4. Help Needed - GIF file isn't displayed well in TK

5. Help needed converting 2.1 for DOS files - Clarion Expert needed

6. Need old file-dbase 1.0 help file?

7. need help with rename-file/delete-file

8. Please Help - NetTools Help File needed

9. Help Files, Need Help

10. ***HELP***HELP***NEED INFORMATION***HELP***HELP

11. need help editing /etc/services file

12. need help in parsing a file with wierd format

 

 
Powered by phpBB® Forum Software