View previous topic :: View next topic
|
Author |
Message |
J.P.R.Kumar
New User
Joined: 02 Apr 2008 Posts: 11 Location: Chennai
|
|
|
|
Hi All,
Can anybody help me by giving the code/clear idea to create a VSAM file using Rexx. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Just TSO/E Command ALLOCATE |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why would you want to use REXX instead of good ole IDCAMS ? |
|
Back to top |
|
|
kabyab
New User
Joined: 31 Aug 2005 Posts: 34 Location: Pune, India
|
|
|
|
Hi expat, I have a similar requirement where in I have to create 240 VSAM datasets required in 240 different JCLs. I am creating those 240 JCLs through REXX.
If there is anyway to create the VSAM Clusters through REXX then it will be great. I can create them through IDCAMS but I was thinking of REXX option. |
|
Back to top |
|
|
J.P.R.Kumar
New User
Joined: 02 Apr 2008 Posts: 11 Location: Chennai
|
|
|
|
I found the solution for my requirement, the same is below
ADDRESS TSO
"ALLOC DS(HANITST) RECORG(KS) LRECL(500) KEYLEN(8) NEW"
DS - DATASET NAME
RECORG - ORGANISATION TYPE
IF we have to be more specific, then we can also use the rexx functions and include space parametres like clusters etc... |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
heu !!!! That was ( 22-08-2008) in my post no ?l |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Something like this
Code: |
/* REXX *** DELETE DEFINE VSAM CLUSTER */
A = " DELETE 'CLUSTER NAME' "
A
A = " DEFINE CLUSTER(NAME (CLUSTER NAME) "
A = A " VOL(*) NOREUSE TRACKS(8 1) "
A = A " INDEXED KEYS(12 0) RECSZ(80 80 )) "
A = A " DATA(CISZ(20480))"
A
|
Or, you could use your REXX to generate all of the VSAM defines into a dataset and only run one IDCAMS. |
|
Back to top |
|
|
kabyab
New User
Joined: 31 Aug 2005 Posts: 34 Location: Pune, India
|
|
|
|
Thanks everyone for the help. I was in a bit of hurry to finish off my assignment so I took an easy way out by coding as follows to create multiple empty VSAM files.
Here my inputs would be
1. 8600 - start cycle
2. 8605 - end cycle
3. KB8675.DBN.REXX.C&CYCL.VSAM.OUTPUT - o/p VSAM dataset
4. KB8675.OUTPUT.VSAM1 - as reference VSAM whose properties have been used to create further cycle noded VSAMs.
Code: |
/* REXX exec to increment cycle by 1 each time until ecycle is reached*/
SAY "enter start cycle no: "
pull scycl
SAY "enter end cycle no: "
pull ecycl
SAY "enter the o/p VSAM Dataset name with C&CYCL"
pull output
SAY "enter the reference VSAM Dataset name"
pull reference
limit = ecycl - scycl + 1
say "limit= " limit
do cntcycl=0 to limit by 1 until ncycl = ecycl
ncycl=scycl+cntcycl
say "newcycl = "ncycl
/*PARSE OUTPUT NAME TO CREATE AN OUTPUT CYCLE NODED VSAM FILE*/
/*REFERENCE VSAM FILE SHOULD BE PRSENT PRIOR TO RUNNING THIS*/
parse upper value output with lftside ."&CYCL" rgtside
pdshaystk = output
pdsneedle = "&CYCL"
pdsovrlay = ncycl
/* say "pdshaystk = "pdshaystk
say "pdsneedle = "pdsneedle
say "pdsovrlay = "pdsovrlay
*/
pdsoffset = pos(pdsneedle,pdshaystk)
if pdsoffset = 0 then
pdsnewstk = pdshaystk
else do
if length(pdsneedle)=length(pdsovrlay) then
pdsnewstk = overlay(pdsovrlay,pdshaystk,pdsoffset)
else
pdsnewstk = substr(pdshaystk,1,pdsoffset-1) || pdsovrlay ||,
substr(pdshaystk,pdsoffset+length(pdsneedle))
end
say "*** pdsnewstk= " pdsnewstk
say " Allocating new VSAM file "pdsnewstk
ADDRESS TSO
"ALLOC DSN('"pdsnewstk"') LIKE('"reference"')"
end
say "goodbye"
|
|
|
Back to top |
|
|
|