• Aucun résultat trouvé

CICS/VS Data Base Design 129

Dans le document Program Product (Page 142-146)

C"SNST] Default 11:'1 iii

Chapter 5. CICS/VS Data Base Design 129

In this case, the record is retrieved as descrited above for the

1. Application Program Retrieves Record Indicating Intention To Sub·

sequently Update It.

2. CICS/VS Applies Exclusive Control To Block For This Task. To Prevent Con·

Current Updating By Other Tasks.

3. Application Program Processes Retrieved Record.

6. CICS/vS Releases Exclusive Control To Permit Other Tasks To Update Block. If Required. manage.eDt routine was generated f~r the installation, file control will ensure that no other concurrently executed task is able to. issue a GET with UPDATE macro instruction for the same logical record for ISAft data sets, physical reccrd for DAft data sets, or control interval for VSAft data sets (referred to as the "physical record" below). This is necessary in a multitasking environment to avoid two or more

concurrently executing tasks updating the same physical record on disk, with the I?Ossibility of losing information resulting frem ene or more

130 CICS/VS System/Application Design Guide

control RELEASE macro instruction (see Figure 5-3). This will permit any other waiting task which alse wishes to updatE the sase physical record to commence its update, at an earlier time than it could if the application program did not iSSUE a RELEASE .acrc instruct-ion.

Records may be added to a data set through the use of a File Control PUT macro instruction indicating that the type of operation is a new record addition. In this caSE, the application trogra~ sust first request that a file work area lFiA) be allocated to enable the new record to be constructed in .ain storage. ThE allocation of an FWA is achieved by issuing a file ccntrcl GETAREA macro instruction specifying the data set name to which the record will be sutse9uently added. The data set name is used to locate the appropriate entry in the FCT and so deter~ine the record length tc be used by CICS/VS in allocating the FiA.

After constructing the new record in the allocated FIA, the application program issues a PUT sacro instruction, specifying that the type of operation is the addition of a new record. The record identification supplied by the program is used to determine where the new record will be added.

If the record identification trovided is a recerd key for addition of new records tc IS1M or key-sequenced VSAM data sets, the record is placed in sequence in the data set based upon that key. For DAft data sets, the new record is inserted as clcse as possible to the specified record location as described below.

For fixed-length unblocked DAft records, such data sets,.ust be initially generated with a nu.ber of dummy records interspersed

throughout the data set. A dummy record is one containing hexadecimal FF in the first byte of the record. The record to be added is inserted in the first available du •• y record, location following the specified record lccation. If no du.my records are availatle in the sase cylinder

(for DOS/VS), the application program is notified; it may then reissue the PUT request for the new record to another part of the data set until a dummy record is found. ihen the new record replaces the du •• y record, file control returns the,record location where the new record is stored to the application program (see Figure 5-4).

Chapter 5. eICS/VS Data Base Design 131

INPUT

APPLICATION PROGRAM AND

CICSNS PROCESSING OUTPUT

1. p,",,,m file I/O area and file work area.

"q"""~110"<;O=- ----l

File 1/0 Area DFHFC TYPE=GETAREA,

DATASET=FI LEl

DFHFC TYPE=PUT, TYP OPER=NEWREC, RDIDADR=ADDRl

Data Set

2. Program constructs output record.

3. Program issues new record put request specifying record location in data set.

4. If unblocked data set, CICS/VS scans cylinder from specified location for first dummy record (X'FF' in first byte).

5. When dummy record found, new record replaces dummy.

6. If blocked data set, CICS/vS writes new record to specified location.

7. CICS/VS returns address of new

record to program.

J

. L . . - - - -_ _

Figure 5-4. CICS/VS Pile Control Addition to Fixed-Length DAM Data.Set

For variable-length record DA! data sets, CICS/VS file control attempts to add the new recoId at the end of the specified track, for CICS/DOS/'S, providing theIe is sufficient space cn that track to contain i,t. For CICS/OS/VS, a spec·ified number cf tracks may be searched to locate a track on which to add the record. If there is not sufficient s~ace, the ap~lication ~rogram is notified, and may Ieissue the POT request for the new record, indicating another track to be used. When the new record has been successfully written at the end of the specified track, its record location is returned to the application program (see Pigure 5-5).

Por entry-sequenced VSA! data sets, new records are always added to the end of the data set regardless of whether they are fixed or

variable-length. The relati~e byte address of the added record in the data set is returned to the application program.

lt~.ngS!m Ii~=.Q!:g ]~l~!iS!Jl (l~j~ Qnl.t)

The file control DBLETE macro instruction is used to specify the deleticn ()f records in a VSA! key-seguenced data set. The specified recoId is physically deleted. The space occupied by that record is reclaimed and added to the available free space in the particular control interval which contained that deleted record.

132 CICS/VS SysteR/Application Design Guide

INPUT PROCESSING

[

.

·~D·-AF~TA;:SOE:T:;FEI~L-GE-El ::~~-~J-11'- -'I"---l-... ---.---' ---l.-P<O:'~"~~~" ~:~

tion of file 1/0 area and file work area.

Fil:'~:~~~~= I .

0,,, So< Ii!!! 'L __ -

1

2. p,,,,,,m 00"",","

~e'-- ---. ---.

Record Lengih·-I . . . - . - - . - .. -.-~:==-':'~-­

Program DFHC TYPE=PUT,

TYP OPER-NEWREC, RDODADR=TRLl

Data Set

output record.

3. Program write new record specifying track location in data set.

. 4. CICSIVS attempts to add record at end of specified track (or tracks for OSIVS).

5. If no space, program specifies new track.

6. CICS/VS returns address

of new record to program.

I '---~

OUTPUT

Dans le document Program Product (Page 142-146)