243 lines
4.3 KiB
RPGLE
243 lines
4.3 KiB
RPGLE
**FREE
|
|
|
|
//=====================================================================
|
|
//
|
|
// Program......: MEDDFNHTST
|
|
//
|
|
// Description..: MEDDFN Hardware Test Program
|
|
//
|
|
// Erstellen mit:
|
|
//
|
|
// CRTRPGMOD MODULE(GOSCH1/MEDDFNHTST)
|
|
// SRCSTMF('/home/GOSCH/meddfn/meddfnhtst.rpgle')
|
|
// OPTION(*EVENTF)
|
|
// DBGVIEW(*SOURCE)
|
|
// TGTRLS(*CURRENT)
|
|
//
|
|
// CRTPGM PGM(GOSCH1/MEDDFNHTST)
|
|
// MODULE(GOSCH1/MEDDFNHTST)
|
|
// BNDSRVPGM(GOSCH1/MEDDFNSRV)
|
|
// ACTGRP(*NEW)
|
|
// TGTRLS(*CURRENT)
|
|
//
|
|
//=====================================================================
|
|
|
|
ctl-opt
|
|
option(*srcstmt:*nodebugio);
|
|
|
|
|
|
/COPY './meddfn_h.rpgle'
|
|
/COPY './meddfnpr.rpgle'
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Program Interface
|
|
//
|
|
//=====================================================================
|
|
|
|
dcl-pi *n;
|
|
|
|
pMediaDef
|
|
char(10) const;
|
|
|
|
pLibrary
|
|
char(10) const;
|
|
|
|
pDevice
|
|
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;
|
|
|
|
pText
|
|
char(50) const;
|
|
|
|
pReplace
|
|
char(4) const;
|
|
|
|
end-pi;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Data
|
|
//
|
|
//=====================================================================
|
|
|
|
dcl-ds MediaDefinition
|
|
likeds(MD_MediaDefinition_T);
|
|
|
|
dcl-ds Error
|
|
likeds(MD_Error_T);
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Build media definition
|
|
//
|
|
//=====================================================================
|
|
|
|
clear MediaDefinition;
|
|
|
|
MediaDefinition.MediaDefinitionName =
|
|
pMediaDef;
|
|
|
|
MediaDefinition.LibraryName =
|
|
pLibrary;
|
|
|
|
MediaDefinition.TextDescription =
|
|
pText;
|
|
|
|
MediaDefinition.MaximumParallelResources =
|
|
1;
|
|
|
|
MediaDefinition.MinimumParallelResources =
|
|
1;
|
|
|
|
MediaDefinition.DeviceAllocation =
|
|
MD_DeviceAllocateAll;
|
|
|
|
MediaDefinition.SaveFormat =
|
|
MD_SaveFormatParallel;
|
|
|
|
MediaDefinition.NumberOfDevices =
|
|
1;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Device
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Device(1).DeviceName =
|
|
pDevice;
|
|
|
|
MediaDefinition.Device(1).NumberOfMediaFiles =
|
|
1;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Media File
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.SequenceNumber =
|
|
0;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.StartingPositionInFile =
|
|
*ALL'0';
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.NumberOfVolumeIdentifiers =
|
|
6;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Volume Identifiers
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(1)
|
|
.VolumeIdentifier =
|
|
pVolume1;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(2)
|
|
.VolumeIdentifier =
|
|
pVolume2;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(3)
|
|
.VolumeIdentifier =
|
|
pVolume3;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(4)
|
|
.VolumeIdentifier =
|
|
pVolume4;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(5)
|
|
.VolumeIdentifier =
|
|
pVolume5;
|
|
|
|
MediaDefinition.Device(1)
|
|
.MediaFile(1)
|
|
.VolumeIdentifier(6)
|
|
.VolumeIdentifier =
|
|
pVolume6;
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Replace
|
|
//
|
|
//=====================================================================
|
|
|
|
MediaDefinition.Replace =
|
|
(pReplace = '*YES');
|
|
|
|
|
|
//=====================================================================
|
|
//
|
|
// Create media definition
|
|
//
|
|
//=====================================================================
|
|
|
|
clear Error;
|
|
|
|
dsply 'MEDDFNHTST START';
|
|
|
|
MD_CreateMediaDefinition(
|
|
MediaDefinition :
|
|
Error);
|
|
|
|
|
|
if Error.HasError;
|
|
|
|
dsply ('ERROR ' + Error.MessageID);
|
|
|
|
else;
|
|
|
|
dsply 'MEDDFN CREATE OK';
|
|
|
|
endif;
|
|
|
|
//=====================================================================
|
|
//
|
|
// End
|
|
//
|
|
//=====================================================================
|
|
|
|
*inlr = *on;
|
|
return; |