Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Define VSAM file using REXX. 2

Status
Not open for further replies.

tolearnrexx

Programmer
Aug 9, 2007
8
0
0
US
Hi,

I have a requirement where I need to define a KSDS using REXX. I have seen examples where a VSAM is searched using REXX but for my requirement I need the VSAM dataset to be defined through REXX. Any help with coding examples is very much needed.

Thanks a lot in anticipation.
 
The DEFINE CLUSTER command:


/* REXX */
"DEFINE CLUSTER -
(NAME(EXAMPLE.KSDS2)) -
DATA -
(RECORDS(500 100) -
EXCEPTIONEXIT(DATEXIT) -
ERASE -
FREESPACE(20 10) -
KEYS(6 4) -
RECORDSIZE(80 100) -
VOLUMES(VSER01) ) -
INDEX -
(RECORDS(300 300) -
VOLUMES(VSER01) ) -
CATALOG(USERCAT)"
Exit 0
 
The format of which you could've easily determined by entering the TSO HELP DEFINE command on the command line of your TSO session.
 

This is not exactly 'a REXX question'. Just because REXX can be used to incite IDCAMS function doesn't make it a REXX function. The same is true of 'REXX panels', and 'REXX JCL'...

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks Rexxhead and mainframe boy for educating me on this. I am new to REXX so could not really judge whether it is a rexx question or not.

Thanks.
 
Hi Rexxhead,

I am trying the syntax you have mentioned as

/* REXX */
"DEFINE CLUSTER (NAME(ETPDBKR.SAMPLE.KSDS2)) -
DATA -
(RECORDS(500 100) -
EXCEPTIONEXIT(DATEXIT) -
ERASE -
FREESPACE(20 10) -
KEYS(6 4) -
RECORDSIZE(80 100) -
INDEX -
(RECORDS(300 300))"
EXIT 0

But am getting the error for this exec as
IRX0030I Error running DEFVSA, line 2: Name or string > 250 characters

Please pardon my lil knowledge of REXX and help me out on this.

Thanks.
 
I made 3 changes to your code.
1 put the cluster name in single quotes
2 add ) after recordsize(80 100))
3 made the entire define statement one litteral by adding double quotes and commas

Try the following:
/* REXX */
"DEFINE CLUSTER (NAME(ETPDBKR.SAMPLE.KSDS2)) ",
"DATA ",
"(RECORDS(500 100) ",
"EXCEPTIONEXIT(DATEXIT) ",
"ERASE ",
"FREESPACE(20 10) ",
"KEYS(6 4) ",
"RECORDSIZE(80 100)) ",
"INDEX ",
"(RECORDS(300 300))"
EXIT 0
 
You said:
Code:
"DEFINE ...
(many lines...)
  ...))"
Everything between the double-quotes is a single string and it's longer than 250 bytes. Making each line of the DEFINE (or any multi-part string) its own string:
Code:
"DEFINE ...  ",
" some more define subparms ",
" the last of the subparms "
will prevent this error.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hi..

Thanks a lot for the responses. I have tried the same something like

/* REXX */
VSAMF = "ETPDBKR.SAMPLE.KSDS2"
"DEFINE CLUSTER (NAME('"VSAMF"'))",
"DATA",
"((RECORDS(500 100)",
"EXCEPTIONEXIT(DATEXIT)",
"ERASE",
"FREESPACE(20 10)",
"KEYS(6 4)",
"RECORDSIZE(80 100))",
"INDEX",
"(RECORDS(300 300))"
Exit 0.

But when I try to execute this am getting some invalid operands like

IKJ56712I INVALID KEYWORD, (RECORDS(500
IKJ56712I INVALID KEYWORD, 100
IKJ56712I INVALID KEYWORD, EXCEPTIONEXIT(DATEXIT).

May be this error is very dormant but am not able to figure it out. Please let me know if I am missing something.

Thanks
Ramesh.
 
It looks like you deleted the space between words. Start or end each new litteral with a space.
 
am trying the same way

/* REXX */
VSAMF = "ETPDBKR.SAMPLE.KSDS2"
"DEFINE CLUSTER (NAME('"VSAMF"'))",
"DATA ",
"((RECORDS(500 100) ",
"EXCEPTIONEXIT(DATEXIT) ",
"ERASE ",
"FREESPACE(20 10) ",
"KEYS(6 4) ",
"RECORDSIZE(80 100)) ",
"INDEX ",
"(RECORDS(300 300))"

But still the same result.. !

Thanks
Ramesh.
 
Try a space at the end of "DEFINE CLUSTER (NAME('"VSAMF"'))",
"DEFINE CLUSTER (NAME('"VSAMF"')) ",

 
Hi ..

Tried that and am still getting the same.

/* REXX */
VSAMF = "ETPDBKR.SAMPLE.KSDS2"
"DEFINE CLUSTER (NAME('"VSAMF"')) ",
"DATA ",
"((RECORDS(500 100) ",
"EXCEPTIONEXIT(DATEXIT) ",
"ERASE ",
"FREESPACE(20 10) ",
"KEYS(6 4) ",
"RECORDSIZE(80 100)) ",
"INDEX ",
"(RECORDS(300 300))"

Dont know what could be wring here.

Thanks
Ramesh.
 
Remove extra ( from "((RECORDS(500 100) ",
it should be "(RECORDS(500 100) ",
 
Cool ..

Thanks a lot .. this works. Am very sorry for bugging you so many times on this. Guess I need to try and understand error messges more carefully.

Thanks again
Ramesh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top