diff --git a/meddfnhtst.rpgle b/meddfnhtst.rpgle new file mode 100644 index 0000000..6f878ca --- /dev/null +++ b/meddfnhtst.rpgle @@ -0,0 +1,231 @@ +**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; + +MD_CreateMediaDefinition( + MediaDefinition : + Error); + + +//===================================================================== +// +// End +// +//===================================================================== + +*inlr = *on; +return; \ No newline at end of file