Using MPE Files [ Getting Started With TRANSACT V ] MPE/iX 5.0 Documentation
Getting Started With TRANSACT V
Using MPE Files
Adding Records
Adding a record to an MPE file uses the same verb and syntax as does
adding a record to an IMAGE dataset or a KSAM file. We have the option
of using LIST with DATA or just using PROMPT alone.
_______________________________________________
| |
| 1 system ex34,file=batchinv(update);|
| 2 list(auto) batchinv; |
| 3 level; |
| 4 data part-number: |
| 5 location: |
| 6 quantity; |
| 7 put batchinv; |
_______________________________________________
Figure 4-5. Program to add data to an MPE file
1 The FILE= option names the MPE file we are going to access. The
default access is READ. UPDATE provides the most complete update
capability to files.
_____________________________________
| |
| PART-NUMBER> p101 |
| LOCATION> bin1 |
| INV-QUANTITY> 100 |
| PART-NUMBER> p102 |
| LOCATION> bin2 |
| INV-QUANTITY> 105 |
| PART-NUMBER> ] |
_____________________________________
Figure 4-6. Adding data to an MPE file
Updating Records
___________________________________________________________
| |
| 1 system ex35,file=batchinv(update); |
| 2 list(auto) batchinv; |
| 3 level; |
| 4 data part-number; |
| 5 set(match) list (part-number); |
| 6 find(serial) batchinv,perform=check-it-out;|
| 7 end; |
| 8 exit; |
| 9 |
| 10 check-it-out: |
| 11 |
| 12 display; |
| 13 input "is this the record to update?"; |
| 14 if input="Y","YES" |
| 15 then |
| 16 do |
| 17 data(set) location: |
| 18 quantity; |
| 19 update batchinv; |
| 20 doend; |
| 21 return; |
___________________________________________________________
Figure 4-7. Program to update records in an MPE file
5 Since there is no chained access to MPE files, we set up a match
criterion to match on part-number.
6 FIND(SERIAL) reads the file serially. For each part-number that
matches the part-number value specified in line 5, the
check-it-out routine is performed.
19 Updating a record in an MPE file uses the same verb and syntax as
updating a record in an IMAGE dataset.
_______________________________________
| |
| PART-NUMBER> p102 |
| |
| PART-NUMBER: LOCATION: QUANTITY:|
| p102 bin2 105 |
| is this the record to update? y |
| LOCATION> |
| INV-QUANTITY> 110 |
| PART-NUMBER> p102 |
| |
| PART-NUMBER: LOCATION: QUANTITY:|
| p102 bin2 110 |
| is this the record to update? n |
| PART-NUMBER> ] |
_______________________________________
Figure 4-8. Updating records in an MPE file
Direct access to an MPE file is possible if the MPE record number is
known. Use the FIND verb with both the DIRECT and RECNO= options to
accomplish this.
MPE/iX 5.0 Documentation