212 lines
5.7 KiB
RPGLE
212 lines
5.7 KiB
RPGLE
**FREE
|
|
|
|
//=====================================================================
|
|
//
|
|
// Program......: MEDDFNHTS2
|
|
//
|
|
// Description..: MEDDFN hardware performance test
|
|
//
|
|
// Creates one media definition for twelve parallel
|
|
// streams across two tape libraries, with six volumes
|
|
// assigned to each library.
|
|
//
|
|
// Erstellen mit:
|
|
//
|
|
// CRTRPGMOD MODULE(GOSCH1/MEDDFNHTS2)
|
|
// SRCSTMF('/home/GOSCH/meddfn/meddfnhts2.rpgle')
|
|
// OPTION(*EVENTF)
|
|
// DBGVIEW(*SOURCE)
|
|
// TGTCCSID(*JOB)
|
|
// TGTRLS(*CURRENT)
|
|
//
|
|
// CRTPGM PGM(GOSCH1/MEDDFNHTS2)
|
|
// MODULE(GOSCH1/MEDDFNHTS2)
|
|
// BNDSRVPGM(GOSCH1/MEDDFNSRV)
|
|
// ACTGRP(*NEW)
|
|
// TGTRLS(*CURRENT)
|
|
//
|
|
//=====================================================================
|
|
|
|
ctl-opt
|
|
option(*srcstmt:*nodebugio);
|
|
|
|
|
|
/COPY './meddfn_h.rpgle'
|
|
/COPY './meddfnpr.rpgle'
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Program Interface
|
|
//
|
|
//=====================================================================
|
|
|
|
dcl-pi *n;
|
|
|
|
pMediaDefinitionName char(10) const;
|
|
pLibraryName char(10) const;
|
|
pDeviceName1 char(10) const;
|
|
pDeviceName2 char(10) const;
|
|
|
|
pVolume1 char(6) const;
|
|
pVolume2 char(6) const;
|
|
pVolume3 char(6) const;
|
|
pVolume4 char(6) const;
|
|
pVolume5 char(6) const;
|
|
pVolume6 char(6) const;
|
|
pVolume7 char(6) const;
|
|
pVolume8 char(6) const;
|
|
pVolume9 char(6) const;
|
|
pVolume10 char(6) const;
|
|
pVolume11 char(6) const;
|
|
pVolume12 char(6) const;
|
|
|
|
pTextDescription char(50) const;
|
|
pReplace char(4) const;
|
|
|
|
end-pi;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Data
|
|
//
|
|
//=====================================================================
|
|
|
|
dcl-ds MediaDefinition
|
|
likeds(MD_MediaDefinition_T);
|
|
|
|
dcl-ds Error
|
|
likeds(MD_Error_T);
|
|
|
|
dcl-s DeviceIndex int(10);
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Build media definition
|
|
//
|
|
//=====================================================================
|
|
|
|
clear MediaDefinition;
|
|
|
|
MediaDefinition.MediaDefinitionName =
|
|
pMediaDefinitionName;
|
|
|
|
MediaDefinition.LibraryName =
|
|
pLibraryName;
|
|
|
|
MediaDefinition.TextDescription =
|
|
pTextDescription;
|
|
|
|
MediaDefinition.Replace =
|
|
(pReplace = '*YES');
|
|
|
|
MediaDefinition.DeviceAllocation =
|
|
MD_DeviceAllocateAll;
|
|
|
|
MediaDefinition.SaveFormat =
|
|
MD_SaveFormatParallel;
|
|
|
|
MediaDefinition.MaximumParallelResources =
|
|
12;
|
|
|
|
MediaDefinition.MinimumParallelResources =
|
|
12;
|
|
|
|
MediaDefinition.NumberOfDevices =
|
|
12;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Devices
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Device(1).DeviceName = pDeviceName1;
|
|
MediaDefinition.Device(2).DeviceName = pDeviceName1;
|
|
MediaDefinition.Device(3).DeviceName = pDeviceName1;
|
|
MediaDefinition.Device(4).DeviceName = pDeviceName1;
|
|
MediaDefinition.Device(5).DeviceName = pDeviceName1;
|
|
MediaDefinition.Device(6).DeviceName = pDeviceName1;
|
|
|
|
MediaDefinition.Device(7).DeviceName = pDeviceName2;
|
|
MediaDefinition.Device(8).DeviceName = pDeviceName2;
|
|
MediaDefinition.Device(9).DeviceName = pDeviceName2;
|
|
MediaDefinition.Device(10).DeviceName = pDeviceName2;
|
|
MediaDefinition.Device(11).DeviceName = pDeviceName2;
|
|
MediaDefinition.Device(12).DeviceName = pDeviceName2;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// One media file per device
|
|
//
|
|
//=====================================================================
|
|
|
|
for DeviceIndex = 1 to 12;
|
|
|
|
MediaDefinition.Device(DeviceIndex).NumberOfMediaFiles = 1;
|
|
|
|
MediaDefinition.Device(DeviceIndex)
|
|
.MediaFile(1).SequenceNumber = 1;
|
|
|
|
MediaDefinition.Device(DeviceIndex)
|
|
.MediaFile(1).StartingPositionInFile = *ALL'0';
|
|
|
|
MediaDefinition.Device(DeviceIndex)
|
|
.MediaFile(1).NumberOfVolumeIdentifiers = 1;
|
|
|
|
endfor;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Volume identifiers
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Device(1).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume1;
|
|
MediaDefinition.Device(2).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume2;
|
|
MediaDefinition.Device(3).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume3;
|
|
MediaDefinition.Device(4).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume4;
|
|
MediaDefinition.Device(5).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume5;
|
|
MediaDefinition.Device(6).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume6;
|
|
|
|
MediaDefinition.Device(7).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume7;
|
|
MediaDefinition.Device(8).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume8;
|
|
MediaDefinition.Device(9).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume9;
|
|
MediaDefinition.Device(10).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume10;
|
|
MediaDefinition.Device(11).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume11;
|
|
MediaDefinition.Device(12).MediaFile(1).VolumeIdentifier(1).VolumeIdentifier = pVolume12;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Create MEDDFN
|
|
//
|
|
//=====================================================================
|
|
|
|
clear Error;
|
|
|
|
MD_CreateMediaDefinition(
|
|
MediaDefinition :
|
|
Error);
|
|
|
|
if Error.HasError;
|
|
|
|
dsply ('MEDDFN creation failed: ' +
|
|
Error.MessageID);
|
|
|
|
dsply Error.MessageData;
|
|
|
|
else;
|
|
|
|
dsply 'MEDDFN created successfully';
|
|
|
|
endif;
|
|
|
|
*inlr = *on;
|
|
return;
|