吃什么能让孕囊长得快:VSAM- POINT

来源:百度文库 编辑:偶看新闻 时间:2024/07/07 16:09:18
1. CREATE KSDS VSAM
DEFINE CLUSTER(NAME(SERS.MSI.RABIL.KSDS.CUST.CLUSTER) -
VOL(ST4258)                             -
TRACKS(10 10)                        -
RECSZ(185 185)                    -
KEY(5 0)                  -
INDEXED)                 -
INDEX(NAME(SERS.MSI.RABIL.KSDS.CUST.INDX))-
DATA(NAME(SERS.MSI.RABIL.KSDS.CUST.DATA))
Note:a. RECSZ (Averange-length max-lengh)  if = then it is F,
else it is V
b. key(5 0)  ->vsam file position start with 0.
2. VSAM Compare
VSAMOrganizationAccess  Reference byRECORD FROMAT Optin
ESDSenter ds sequencesequence,random(RBA)RBAF OR Vinsert update
KSED logic sequence base upon  unique keysequence,random(KEY)RBA , KEYF OR Vinsert update delete
RRDSpre-formatted fixed-length slots(1
SLOT contains 1 record,  every slot's
length is fix. But several slot may different(in this case .it is V)sequence,random(RRN)RRNF OR Vinsert update delete
(when delte, then slot
will be empty)
LDSa VSAM data set with a control interval
size multiple of 4096 bytes;
All LDS bytes are data bytes
3. fundemental know
3.1 CI
CI(Control interval)          -->  LR(logic record)1.It is the fundamental building block of every VSAM file
---> FS(Free space)2.A CI is a contiguous area of direct access storage that
--->control information-> RDF & CIDFVSAM uses to store data records and control
RDF-RECORD DESCRIPTOR FILELDinformation that describes the records.
CIDF-CONTROL INTERVAL FILELD
logic record    freespace
LR1|LR2|LR3| FS| RDF|RDF|CIDF|
control information
CIDF-4 BYTES->leftmost 2 bytes indentify the area occupied by logic records
-> rightmost 2 bytes contains the ammout of unused space
Bitmap                                                                                           RDF-LENGTH OF REC
RDF(FIX RECORD)-3 BYTES->  Have 2 RDF
How many with same lengh
RDF(Variable RECORD)-3 BYTES->  1 record have 1 RDF
3.2 component and entry
Bitmap                              1. DATA(ESDS ,KSDS ,RRDS ,LDS)
componet
2. INDEX(KSDS)
ENTRY-NAME of component
CLUSTER-to treat index and data components as a single entity
index ->contains KEY + RBA
vsamepoint
Alternate Index->for KSDS or of an ESDS -> unique or non-unique
ESED RBA
KSDS key
3.3 AIX
The format of an AIX record is as follows0Flag ByteContains X'00' if the base cluster is an ESDS, X'01' if it is a KSDS
1Length of PointerIf the base cluster is an ESDS, this field contains X'04'. If the base cluster is a KSDS, this field contains the 8-bit length of the primary key
2Count of number of pointersAlways X'0001' if the AIX is DEFINE'd with the UNIQUEKEY attribute. If the AIX is DEFINE'd with the NONUNIQUEKEY attribute and duplicate keys are present, the count may have a value greater than 1, up to 32767
4Length of alternate keyKey length of the alternate index
5Alternate keyAlternate index key
**Pointer(s) to base record(s)4-byte RBA (ESDS) or primary key (KSDS); if the AIX is DEFINE'd with the NONUNIQUEKEY attribute, multiple pointers may be present, as specified in the count field at offset 02 in the AIX record.
1BYTE          | 1 BYTE                       | 2 BYTES                     |          1byte                         |
flage byte | length  of pointer|  count of pointers|length of alternate key|aternate key
********************************* TOP OF DATA ************
LUO JUN     420115000000000002                       X'01'-  KSDS   X'12' - KSDS KEY LENGTH is 18
01000 DED4DED4444 FFFFFFFFFFFFFFFFFF                      X'0001'  the number  of key is 1 name is 'LUO JUN'
1201B 34601450000 420115000000000002                      X'0B'  Alternative key length is  11
----------------------------------------------------------
LUO XIN     420115000000000003420115000000000004
01000 DED4ECD4444 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF     X'01'-  KSDS   X'12' - KSDS KEY LENGTH is 18
1202B 34607950000 420115000000000003420115000000000004    X'0002'  the number  of key is 2 for name is 'LUO JUN'
X'0B'  Alternative key length is  11
4. AIX
4.1.USING AIX STEP:
A. DEFIEN AIX
B. DEFINE PATH
C.BULDINDEX  ->  build aix index if define ony. Then aix will have not data
4.2 AIX sample RABIL.BEL.PS.EMP.DATA
DELETE RABIL.BEL.KSDS.EMP.CLUSTER PURGE420115000000000001 LI GANG
IF MAXCC=8 THEN SET MAXCC=0           420115000000000002 LUO JUN
DEFINE CLUSTER -                       420115000000000003 LUO XIN
(NAME(RABIL.BEL.EMP.CLUSTER) -  420115000000000004 LUO HUA
RECORDS(100 10)  -             420115000000000005 LI BIN
RECSZ(80 80)  -                420115000000000006 QIN HUI
KEYS(18 0) -                   420115000000000007 QIN ZHANG
INDEXED -
) -                            RABIL.BEL.EMP.CLUSTER
INDEX -                        420115000000000001 LI GANG
(NAME(RABIL.BEL.EMP.INDEX)) -  420115000000000002 LUO JUN
DATA  -                        420115000000000003 LUO XIN
(NAME(RABIL.BEL.EMP.DATA))     420115000000000004 LUO HUA
REPRO IDS(RABIL.BEL.PS.EMP.DATA) -    420115000000000005 LI BIN
ODS(RABIL.BEL.EMP.CLUSTER)      420115000000000006 QIN HUI
DEFINE AIX -                                      420115000000000007 QIN ZHANG
(NAME(RABIL.BEL.EMP.CLUSTER.AIX) -
RELATE(RABIL.BEL.EMP.CLUSTER) -           RABIL.BEL.EMP.CLUSTER.AIX
RECORDS(100 10)  -                        .....LI BIN             420115000000000005
RECSZ(80 80)  -                           .....LI GANG        420115000000000001
KEYS(11 19) -                              -> the key offset start in 0. so if in cluster
key from 20. then here should be 19......LUO HUA       420115000000000004
UNIQUEKEY   -                             .....LUO JUN        420115000000000002
UPGRADE  -                                .....LUO XIN         420115000000000003
REUSE -                                    -> IF NOREUSE, it will open error with 232
default it is NOREUSE.....QIN HUI         420115000000000006
)        -                                .....QIN ZHANG  420115000000000007
5.SELECT    ASSIGN TO
SELECT file-name
ASSIGN    TO  DDname
ORGANIZATION  IS  INDEXED|RELATIVE|SEQUENTIALKSDS-INDEXED RRDS-RELATIVE    ESDS-SEQUENTIAL
ACCESS  MODE  IS   SEQUENTIAL| RANDOM| DYNAMIC
RECORD   KEY  IS  data-name-1
[ALTERNATE RECORD KEY IS data-name-2
[ WITH DUPLICATES]]
[FILE STATUS  IS  data-name-3].
6.READ VSAM FILE
Sequential READ format:
READ file-name [NEXT RECORD]ACCESS MODE IS SEQUENTIAL-NEXT RECORD can be ignored
ACCESS MODE IS DYNAMIC- NEXT RECORD can't be ignored
[INTO data-name-1]
[AT END statement-1]
[END-READ].
Random READ format
READ file-name [RECORD]
[INTO data-name-1]
[KEY IS data-name-2]
[INVALID KEY statement-2]
[END-READ].
7. Write /Rewrite  VSAM FILE
WRITE rec-name [FROM data-name]
[INVALID KEY statement] - > INVLIAD KEY when an attempt is made to write records with duplicate keys.
END-WRITE.
REWRITE rec-name [FROM data-name]
[INVALID KEY statement]Invalid key condition is triggered when the value contained in the prime RECORD KEY/RELATIVE KEY does not equal to  any of the primary record key/ relative key in the records in the file.
END-REWRITE.
8. ESDS   SELECT STATEMENT
FILE-CONTROL.
SELECT EMP-FILE ASSIGN TO AS-EMPFIL        the file name [ASSIGN TO] must prefix with 'AS-'
ORGANIZATION   IS SEQUENTIAL
ACCESS MODE    IS SEQUENTIAL
FILE STATUS    IS WS-EMPFIL-STATUS.
in JCL CODE LIKE below:
//EMPFILE     DD DSN=FILENAME,DISP=SHR