I need to open 600 empty VSAM files (MVS mainframe) and add a dummy record
to all 600. I am fairly experienced in REXX, but have not done any VSAM work
in REXX. Can anybody help? Any example would be much appreciated.
Thanx & a belated happy new year to all
Amy
If you have IBM's File Manager for z/OS and OS/390, you could use the
following sample proc and JCL. This takes an existing VSAM file and
initializes it with one record of binary zeros. You can modify it as
needed...
//DSGPROC PROC
//FILEMAN EXEC PGM=FILEMGR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD *
$$FILEM DSG OUTPUT=DDOUT,FILLCHAR=x'00',DISP=OLD,NLRECS=1
/*
In your JCL, all you would need would be
//VSAMINIT EXEC DSGPROC
//DSGPROC.DDOUT DD DISP=OLD,DSN=any.vsam.file.to.initialize
Simply repeat the DDOUTstatement for each data set that you need.
I guess you could use a REXX routine to supply all of the data set names to
the JCL.
/* REXX */
/* Invoke File Manager to initialize a VSAM file (low value records) */
FILEMGR "$DSG
DDOUT='any.vsam.file.to.initialize',FILLCHAR=x'00',DISP=OLD,NLRECS=1"
intRCode = RC
If intRCode > 0 Then
Say 'File Manager DSG function ended RC='intRCode
Depending on the data set names you are going to need, you could use some of
File Manager's other built-in functions to build the list and loop through
each of the names.
Allocate a file to DD(DUMYREC) (on VIO for efficiency) with LRECL
appropriate for your dummy record.
Write your dummy record to DUMYREC, closing the file.
Invoke TSO REPRO: REPRO IFILE(DUMYREC) ODS('VSAM-dsname') .
For each VSAM file needing the same dummy record, invoke REPRO with
appropriate ODS. For each file with different dummy record
requirements, FREE DD(DUMYREC) and repeat the above process creating a
new DUMYREC and dummy record with appropriate attributes. Not
particularly elegant, but should work.
Since VSAM considers all records in a KSDS to be variable length, VSAM
only requires your dummy record to be large enough to contain the key
field(s), but your applications that access the files might impose
additional requirements.
--
Joel C. Ewing, Fort Smith, AR jce...@acm.org
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
RXVSAM written by Mark Winges and enhanced by
Rob Van Riel is an excellent open source freeware
function package for REXX to provide access to VSAM files.
http://www.cbttape.org/ftp/cbt/CBT268.zip
We use it at Landmark pretty extensively in a large home grown REXX application
that packages SYSMODs and it has proved very reliable overy the past several
years of heavy use.
Best Regards,
Sam Knutson
"ALLOC F(indd) DA("infile") SHR"
"ALLOC F(otdd) DA("outfile") SHR"
"REPRO INFILE(indd) OUTFILE(outdd)"
"Free f(indd)"
"Free f(outdd)"
That's it, no third party software is needed. Idcams commands work
from within REXX.
Fred Maestas
My opinions are my own....
"A Farzanegan" <ahmad.fa...@virgin.net> wrote in message news:<1tW%7.22205$ru2.290734@NewsReader>...
Fred M....
"Larry Kahm" <lk...@bellatlantic.net> wrote in message news:<Xdl18.2749$pQ5...@nwrddc01.gnilink.net>...