It's wonderfull to see all the different ideas for accomplishing a task. It
just shows you there's no one way to get things done.
I'll through in something that was published as an idea in Interex (hope
nobody cares at Interex).
Here is a command script that lets you execute a MPE command against a file
set. I modified it for my needs, but as it's a script, do what you want.
-----Original Message-----
From: Ralph Alexander, Ing. [SMTP:[log in to unmask]]
Sent: Thursday, July 03, 1997 5:36 AM
To: [log in to unmask]
Subject: complete copy of a group
Hi,
Every month I have to store all files of a group, do some jobs
and restore the files. The files are not very large, but there are
KSAM files included.
Does anyone know a way to copy these files to another group ?
Ralph
[Dave Gale]
PARM CMD=?,FILESET=@,PROMPT=YESY,TEMPWORK=EXTEMP
COMMENT EX COMMAND FILE COPIED FROM INTERACT MAGAZINE
COMMENT H.G.ULRICH IAGB
COMMENT ENTERED BY DMG
IF "!CMD"="?"
ECHO EX Command File.
ECHO
ECHO Description - EXecutes an MPE file command against a set of files.
ECHO
ECHO Syntax :
ECHO EX (MPE Command),(File set),(verify prompt),(work file
name)
ECHO
ECHO Parms:
ECHO MPE Command - Any mpe command meant to be issued against a
file
ECHO (i.e. PRINT, PURGE, RELEASE, SECURE ..etc)
ECHO File Set - A file set meant to be used by the LISTF or
ECHO LISTFILE command (default = @)
ECHO Verify Prompt - Prompt for each command execution
ECHO Work File Name - Name of temporary file used (default
EXTEMP)
ECHO
ECHO Examples :
ECHO EX PURGE @.TEMPDATA (purges all files in TEMPDATA, prompts
first)
ECHO EX RELEASE @ NO (Releases all files with out prompting)
ECHO EX HELP @.CMD NO (Lists all files in the CMD group)
ECHO EX PRINT @.SOURCE (Prints all files in the SOURCE group)
RETURN
ENDIF
ERRCLEAR
IF FINFO("!TEMPWORK","EXISTS") THEN
INPUT _EX_RESP," Temporary file !TEMPWORK already exists, OK to purge? "
If str(ltrim(rtrim(ups(_EX_RESP))),1,1)='Y'
ERRCLEAR
PURGE !TEMPWORK,TEMP>$null
IF CIERROR = 383
ECHO The file !TEMPWORK does not exist in the temporary domain.
ECHO This could be a permanent file with the same name.
ECHO
SETVAR _EX_RESP ' '
INPUT _EX_RESP, 'OK to purge the permanent file !TEMPWORK? '
If str(ltrim(rtrim(ups(_EX_RESP))),1,1)='Y'
PURGE !TEMPWORK
ENDIF
ENDIF
ELSE
ECHO Temporary file !TEMPWORK already exists, EX canceled.
ECHO To restart EX, specify a custom work file or answer YES
ECHO in reponse to the PURGE request.
ECHO
RETURN
ENDIF
ENDIF
ERRCLEAR
FILE !TEMPWORK;MSG
CONTINUE
LISTFILE !FILESET,QUALIFY > *!TEMPWORK
IF CIERROR <> 0 OR HPCIERR <> 0
ECHO LISTFILE !FILESET,QUALIFY
IF HPCIERRCOL > 0 THEN
ECHO ![RPT(" ",HPCIERRCOL-1)+"^"]
ENDIF
ECHO !HPCIERRMSG
RESET !TEMPWORK
PURGE !TEMPWORK,TEMP
RETURN
ENDIF
RESET !TEMPWORK
WHILE FINFO("!TEMPWORK","EOF")>0 DO
INPUT _EX_NEXT <!TEMPWORK
SETVAR _EX_NEXT RTRIM(_EX_NEXT)
IF UPS("!PROMPT")<>"NO" THEN
INPUT _EX_YES;PROMPT="!CMD !_EX_NEXT (Y/N) ? >"
ELSE
SETVAR _EX_YES "Y"
ECHO !CMD !_EX_NEXT
ENDIF
IF UPS(_EX_YES)="Y" THEN
ERRCLEAR
CONTINUE
!CMD !_EX_NEXT
IF CIERROR <> 0 OR HPCIERR <> 0
ECHO !CMD !_EX_NEXT FAILED RESTART ATTEMPTED
ENDIF
ELSE
ECHO !CMD !_EX_NEXT BYPASSED
ENDIF
ENDWHILE
DELETEVAR _EX_@
PURGE !TEMPWORK,TEMP
|