JCL for VSAM.docx
- 文档编号:29018418
- 上传时间:2023-07-20
- 格式:DOCX
- 页数:13
- 大小:17.36KB
JCL for VSAM.docx
《JCL for VSAM.docx》由会员分享,可在线阅读,更多相关《JCL for VSAM.docx(13页珍藏版)》请在冰豆网上搜索。
JCLforVSAM
VirtualStorageAccessMethod(VSAM)
VSAMisanaccessmethodthat:
∙allowssequentialaccesstofileseitherbyakeyorbysequence
∙allowsdirectaccessbykey,relativebyteaddress,orbyrelativerecordnumber
AVSAMfileisknownasacluster
Therearethreetypesofclusters:
1.EntrySequencedDataSet(ESDS)
2.RelativeRecordDataSet(RRDS)
3.KeySequencedDataSet(KSDS)
EntrySequencedDataSet(ESDS)
∙allowsforsequentialaccessandorganizationonly
∙recordsareaccessedbytheirrelativebyteaddress
∙recordsareaddedattheend
∙mayhavefixedorvariablelengthrecords
∙consistsofonlyadatacomponent
RelativeRecordDataSet(RRDS)
∙allowsbothrandomandsequentialaccess
∙recordsareaccessedbyarelativerecordnumber(hashnumber)
∙mayhavefixedlengthrecordsonly
∙consistsofadatacomponentonly
KeySequencedDataSet(KSDS)
∙allowsbothrandomandsequentialaccess
∙recordsareaccessedbyauniquekeyvalue(index)
∙mayhavefixedorvariablelengthrecords
∙consistsofadataandindexcomponent
Thedatacomponentismadeupofdatarecords,whicharetheactualrecordsthatarereadintoorwrittenfromaprogram.Thedatarecordsarestoredinascendingkeysequence.
Thedatarecordsaregroupedintocontrolintervals.EachCIhasafixedlength,maycontainrecordsandfreespace,andhascontrolinformationstoredatthebottom.
Thecontrolintervalsaregroupedintocontrolareas.Thenumberofcontrolintervalspercontrolareadependsonhowmuchspaceisreservedwhenthedatasetiscreated.
Theindexcomponentismadeupofanindexsetandasequenceset.
Theindexsetliststhelargestindexwithineachcontrolarea.
Thesequencesetliststhelargestindexwithineachcontrolinterval.
Addingrecordstoacluster
Whenthereisenoughfreespacewithinacontrolintervaltoaddanewdatarecord,therecordisaddedinthepositionthatwillmaintainkeysequence.
WhenthereisannotenoughfreespacewithinacontrolintervalANDthereisanemptycontrolintervalwithinthesamecontrolarea,acontrolintervalsplitwilloccur.Recordsfromthefullcontrolintervalaremovedtotheemptyone.
WhenthereisannotenoughfreespacewithinacontrolintervalANDthereisnotanemptycontrolintervalwithinthesamecontrolarea,acontrolareasplitwilloccur.Spacewillbeallocatedforanewcontrolarea.Recordsaremovedtothenewcontrolarea.Acontrolintervalsplitoccursintheoldcontrolarea.
Accessingrecordsinacluster
Twotypesofpointers(verticalandhorizontal)areusedtoaccessrecords.Theverticalpointersareusedfordirectaccessbykey.Thehorizontalpointersareusedforsequentialaccess.
Creating,maintaining,anddeletingVSAMclusters
VSAMclustersaremanagedbyautilitycalledIDCAMS.
IDCAMSJCL:
//stepnameEXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
controlstatements
/*
Dependingontheoperationbeingperformed,otherDDstatements
mightbeincluded.
Eg:
删除VSAM文件NUC0.FETAT01.VIQ
//NUH60M00JOB(COUNT),'YUYAN',CLASS=B,MSGCLASS=X,
//MSGLEVEL=1,REGION=6000K,NOTIFY=&SYSUID
//*
//*初始化删除数据集NUC0.FETAT01.VIQ
//STEP001EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DELETE(NUC0.FETAT01.VIQ)SCRATCH
IFLASTCCLT9THEN
DO
SETMAXCC=0
//*
controlstatements:
-mustbeginbetweencolumns2and16
-forcontinuation,useahyphenasthelastnon-blankcharacter
-placecommentsbetween/*and*/thatdoesn'tstartincol1
Todefineacluster:
DEFINECLUSTER(parameters)
Requiredparamters:
NAME(cluster_name)
thisspecifiesthenameoftheclusterandmustbe
between1and44characters
VOLUMES(volume_number)
thisspecifiesthevolumethattheclusterwillbe
puton.Either:
ACA301orACA302
TRACKS(primarysecondary)
CYLINDERS(primarysecondary)
RECORDS(primarysecondary)
thisspecifiestheamountofspacetoreserveforthecluster
primary:
allocatedonce
secondary:
allocatedupto122times
INDEXEDNONINDEXEDNUMBERED
(KSDS)(ESDS)(RRDS)
thisspecifiesthetypeofclusterthatisbeingcreated
KEYS(lengthoffset)
thisspecifiesthekeyforaKSDScluster
length:
lengthofthekey
offset:
locationofthekey(0based)
default:
KEYS(640)
RECORDSIZE(averagemaximum)
thisspecifiesthesizeofarecord
ifrecordlengthisfixed,averageandmaximumshouldbeequal
codethisiftheRECORDSparameterisused
default:
RECORDSIZE(40984098)
Optionalparameters:
REPLICATENOREPLICATE
REPLICATEspecifiesthateachKSDSindexsetshouldbe
writtenasmanytimesaspossibleonatrack
default:
NOREPLICATE
IMBEDNOIMBED
IMBEDspecifiesthateachKSDSsequencesetshouldbe
writtenasmanytimesaspossibleonatrack
default:
NOIMBED
SPANNEDNONSPANNED
SPANNEDspecifiesthatalargeKSDSdatarecordcan
spillacrosscontrolintervalboundaries
default:
NONSPANNED
FREESPACE(control_interval_%control_area_%)
thisspecifiestheamountoffreespacetobeleftinthe
clusteraftertheinitialloadandafteranysplitoccurs.
forfileswithmanyrecordsbeinginserted,somefreespace
shouldbespecified
forstaticfiles,defaultissufficient
default:
FREESPACE(00)
REUSENOREUSE
thisspecifieswhethertheclusteristemporary(REUSE)or
permanent(NOREUSE)
default:
NOREUSE
OWNER(owner_id)
thisspecifieswhoownsthecluster
TO(julian_date)
specifiestheexpirationdateforthefile
FOR(number_of_days)
specifiesthenumberofdaysthatthefileshouldexist
aftercreation
WRITECHECKNOWRITECHECK
thisverifiesthatrecordsarebeingread/writtencorrectly
default:
NOWRITECHECK
Example:
//EXMPL1EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DEFINECLUSTER(/*DEFINEACLUSTER*/-
NAME(Z123456.ESDS)/*CLUSTERNAMEISZ123456.ESDS*/-
VOLUMES(ACA302)/*CLUSTERISONACA302*/-
RECORDS(2010)/*PRIM:
20RECORDS,SEC:
10RECORDS*/-
RECORDSIZE(4040)/*FIXEDLENGTH40BYTERECORDS*/-
NONINDEXED)/*CLUSTERISESDS*/
/*
ThedataandindexcomponentsforaKSDSclustercanbedefined
separatelybyusing:
DATA(parameters)andINDEX(parameters)
//EXMPL2EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DEFINECLUSTER(-
NAME(KSDSCLUS)-
VOLUMES(ACA301)-
INDEXED-
TRACKS(11))
DATA(-
NAME(KSDSDATA)-
KEYS(2137)-
RECORDSIZE(121121))
INDEX(-
NAME(KSDSNDX)-
REPLICATE)
/*
//NUDEFJOBJOB(ACCT#),'LIBIN',NOTIFY=&SYSUID,
//CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),COND=(0,NE)
//NUWORKSEXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DELETE(ZNUP.VBD.JOBCARD)-
PURGE-
CLUSTER
IFLASTCCLT9THEN-
DO
SETMAXCC=0
DEFINECLUSTER-
(NAME(ZNUP.VBD.JOBCARD)-
VOLUMES(USER01)-
SHAREOPTION(2,3)-
CYL(1,1)-
FSPC(15,10))-
DATA(NAME(ZNUP.VBD.JOBCARD.DATA)-
RECSZ(100,100)-
KEYS(20,0)-
CISZ(4096))-
INDEX(NAME(ZNUP.VBD.JOBCARD.INDEX))
/*
//*
//*ENDOFJCL,MEMBER=NUDEFJOB
Todeleteacluster:
DELETE(cluster_name)
Optionalparamters:
PURGENOPURGE
thisspecifiesthattheclustershouldbedeletedevenif
it'sbeforetheexpirationdate
default:
NOPURGE
ERASENOERASE
ERASEspecifiesthatthespaceshouldberewrittenwith
binaryzeros
default:
NOERASE
//EXMPL3EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DELETE(Z123456.ESDS)
/*
//EXMPL4EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
DELETE(KSDSCLUS)
ERASE
/*
Tocopyfrom/intoanotherdataset:
REPROparameters
Requiredparamters:
INFILE(ddname)orINDATASET(cluster_name)
thisspecifiesthefilethatistobeusedforinput
OUTFILE(ddname)orOUTDATASET(cluster_name)
thisspecifiesthefilethatistobeusedforoutput
Optionalparamter:
COUNT(n)
thisspecifiesthatnrecordsshouldbecopiedtotheoutput
dataset
default:
copyall
//EXMPL5EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//INDDDDDSN=Z123456.INPUT,...
//SYSINDD*
REPRO-
INFILE(INDD)-
OUTDATASET(Z123456.ESDS)
/*
//EXMPL6EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//INDDDDDSN=Z123456.INPUT,...
//OUTDDDDDSN=Z123456.OUTPUT,...
//SYSINDD*
REPRO-
INFILE(INDD)-
OUTFILE(OUTDD)
/*
Toprintacluster:
PRINTparameters
Requiredparamters:
INFILE(ddname)orINDATASET(cluster_name)
thisspecifiesthefilethatistobeprinted
Optionalparamters:
OUTFILE(ddname)
thisspecifiesthefilethattherecordsaretobewrittento
ifnotspecified,writestoSYSPRINT
CHARACTERHEX
thisspecifiestheformatthattherecordsshouldbeprintedin
default:
HEX
//EXMPL7EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
PRINT-
INDATASET(Z123456.ESDS)-
CHARACTER
/*
//EXMPL8EXECPGM=IDCAMS
//SYSPRINTDDSYSOUT=*
//SYSINDD*
PRINT-
INDATASET(Z123456.ESDS)-
CHARACTER
PRINT-
INDATASET(KSDSCLUS)-
CHARACTER
/*
TodisplayVSAMcataloginformation:
LISTCATparameters
Optionalparamters:
CATALOG(catalog_name)
thisspecifieswhichcatalogcontainstheentriestobelisted
NAMEVOLUMEALLOCATIONHISTORYALL
thisspecifieshowmuchinformationshouldbedisplayed
default:
NAME
ENTRIES(entry_name)
thisspecifieswhichentry/entriesshouldbedisplayed
CLUSTERDATAINDEXUSERCATALOG
thisspecifieswhichentryshouldbeprintedifanentry
specifiedintheENTRIESparameterisnotunique
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- JCL for VSAM