attribute of VSAM in REXX

Time Sharing Option, Interactive System Productivity Facility and REstructured eXtended eXecutor

Moderator: mickeydusaor

Post Reply
Sumit Mehra
Registered Member
Posts: 19
Joined: Sun Feb 21, 2016 5:43 pm

attribute of VSAM in REXX

Post by Sumit Mehra »

Hello all ,

I am looking for the command where we can get the attribute of VSAM in REXX command. Could someone please help me?

Thank you
User avatar
zum13
Registered Member
Posts: 89
Joined: Thu May 04, 2023 12:58 am

Re: attribute of VSAM in REXX

Post by zum13 »

Hello.

Assuming that you have no nice REXX add-on function packages to play with that will allow you to get the information more easily, you can trap the output of the TSO "LISTCAT" command. For example, this will pull the value of "KEYLEN":

Code: Select all

/*REXX*/ 
Call OutTrap "OUTPUT." 
Address TSO "LISTCAT ENTRIES(VSAMDS) CLUSTER DATA INDEX ALL"
Call OutTrap "OFF" 

Keylen = ""                                                            
Do   I = 1 To Output.0 Until Keylen ¬= ""
     Locate = Pos(" KEYLEN--",Output.I) 
     If   Locate > 0 Then 
          Keylen = Word(Substr(Output.I,Locate),1) 
End 
                                                            
Say Keylen 
Sumit Mehra
Registered Member
Posts: 19
Joined: Sun Feb 21, 2016 5:43 pm

Re: attribute of VSAM in REXX

Post by Sumit Mehra »

Thanks zum13, this is good example for me to start with.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: attribute of VSAM in REXX

Post by enrico-sorichetti »

see
File # 726 Generate VSAM DEFINE statements from VSAM file
https://cbttape.org/ftp/cbt/CBT726.zip

Code: Select all

//***FILE 726 is from Ted MacNeil, and contains a REXX exec to      *   FILE 726
//*           generate DEFINE statements for VSAM files, directly   *   FILE 726
//*           from the file itself.  Details are explained below.   *   FILE 726
//*                                                                 *   FILE 726
//*     This code either displays a VSAM entry or writes the        *   FILE 726
//*     IDCAMS control statement needed to define a VSAM file.      *   FILE 726
//*     (MUST run under ISPF.)                                      *   FILE 726
//*                                                                 *   FILE 726
//*     From ISPF 3.4, type VC3 next to a VSAM data set             *   FILE 726
//*                                                                 *   FILE 726
//*     Further modified by Philippe Simon.  Please see members     *   FILE 726
//*     VCP and VCP$$ for his version and explanation thereof.      *   FILE 726
//*                                                                 *   FILE 726
//*     email for Philippe Simon:  philippe_simon_55@yahoo.fr       *   FILE 726
//*                                                                 *   FILE 726
//*     Originally Written by Jim Connelley.  Jim's version is      *   FILE 726
//*     included here as member VC.                                 *   FILE 726
//*                                                                 *   FILE 726
//*     No copyright.                                               *   FILE 726
//*     If you want to, send your enhancements to                   *   FILE 726
//*                                                                 *   FILE 726
//*             email:  tedmacneil@bell.blackberry.net              *   FILE 726
//*                                                                 *   FILE 726
//*     Reason for this REXX:                                       *   FILE 726
//*             I needed a method to clean up our old               *   FILE 726
//*             VSAM with the keywords: REPLICATE, IMBED            *   FILE 726
//*             and KEYRANGE. This was the fastest way.             *   FILE 726
//*             Those parameters are caught but not                 *   FILE 726
//*             written to control cards.                           *   FILE 726
//*             I also added a few lines to do a:                   *   FILE 726
//*             DELETE ------ PURGE at the front                    *   FILE 726
//*             (Optional)                                          *   FILE 726
//*                                                                 *   FILE 726
//*     There are bugs, such as handling multi-volume files, but    *   FILE 726
//*     that's where YOU come in.                                   *   FILE 726
//*     (-- Ted MacNEIL -- I believe I fixed this bug, but I did    *   FILE 726
//*                        not have any multi-volumes to test       *   FILE 726
//*                        with.)                                   *   FILE 726
//*                                                                 *   FILE 726
//*     (-- The dependency on STEMVIEW was removed to either write  *   FILE 726
//*      -- out to a file or stay inside a loop)                    *   FILE 726
//*                                                                 *   FILE 726
//*   Syntax:                                                       *   FILE 726
//*                                                                 *   FILE 726
//*     %VC3 VSAMDSN pds member DELETE                              *   FILE 726
//*                                                                 *   FILE 726
//*       VSAMDSN -- the VSAM FILE you wish to CLONE                *   FILE 726
//*                  (if you specify quotes, they are removed)      *   FILE 726
//*                                                                 *   FILE 726
//*       pds     -- where to output the control cards (Optional)   *   FILE 726
//*                - default: <userid>.VSAM.CONTROL.CARDS           *   FILE 726
//*                                                                 *   FILE 726
//*       member  -- the member name used to output the statements  *   FILE 726
//*                  (Optional)                                     *   FILE 726
//*                                                                 *   FILE 726
//*       DELETE  -- Insert DELETE <entry> PURGE                    *   FILE 726
//*               -- (Optional)                                     *   FILE 726
//*                                                                 *   FILE 726
//*     NOTE: 1. if PDS does not exist, this outputs to the screen  *   FILE 726
//*                                                                 *   FILE 726
//*           2. The only entry types supported are:                *   FILE 726
//*              ignored and only the DEFINE ALIAS ... RELATE       *   FILE 726
//*              will be output. There is not enough information    *   FILE 726
//*              in the LISTCAT output to rebuild the catalogue.    *   FILE 726
//*                                                                 *   FILE 726
might not be the full solution but a good starting point

find attached the content of the XMIT file
You do not have the required permissions to view the files attached to this post.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Sumit Mehra
Registered Member
Posts: 19
Joined: Sun Feb 21, 2016 5:43 pm

Re: attribute of VSAM in REXX

Post by Sumit Mehra »

Thank you enrico, I am working with the example.
Sumit Mehra
Registered Member
Posts: 19
Joined: Sun Feb 21, 2016 5:43 pm

Re: attribute of VSAM in REXX

Post by Sumit Mehra »

Geigygog wrote: Wed Jan 24, 2024 3:13 pm Have you successfully implemented the REXX code provided by zum13, and do you have any specific challenges or questions regarding its usage for obtaining VSAM attributes?
Yes, the code is working for me.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “TSO, ISPF & REXX (Do you still do CLIST?!).”