Subject: | |
From: | |
Reply To: | |
Date: | Thu, 7 Nov 1996 11:57:58 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Rodney,
I use the following CMD file in a number of my job streams. I just invoke it with the
file specification that I am concerned about being in use. The CMD file sets a JCW
(INUSE) that can then be checked in the job.
I call the CMD file CHACTIVE for CHeck ACTIVE and invoke it as follows:
!CHACTIVE @F@
!IF INUSE = 1
! TELLOP *JPAYCALC - FILES IN USE CANNOT CREATE BEFORE TAPE
! TELLOP *JPAYCALC - CORRECT AND STREAM JPAYCALC AGAIN
! SJ .BPP
! EOJ
Here is the CMD file:
SOURCE:help chactive
USER DEFINED COMMAND FILE: CHACTIVE.CMD.SYSBOE
parm File_Name="None",Entry="Main",Flen=0
option nolist
if "!Entry"="Main"
LISTF !File_Name,2>temp
setvar templen finfo("temp",19)
chactive Entry="Check" Flen=templen<temp
return
endif
if "!Entry"="Check"
setvar tempctr 0
setvar inuse 0
while tempctr<!flen
setvar temprec " "
input temprec
if len("!temprec") > 20
if str("!temprec",9,1)="*"
setvar inuse 1
endif
endif
setvar tempctr tempctr + 1
endwhile
deletevar temprec
deletevar tempctr
deletevar templen
return
endif
Hope this helps.
--
Thomas A Harmon (715) 833-5513
Systems Analyst mailto:[log in to unmask]
Eau Claire Area School District
500 Main Street
Eau Claire, WI 54701
|
|
|