Jim,
This is the way to get the TSCOMID and SESID value you need at execution time.
You need to execute this code at the end of your focexec. (as a focexec himself using -INCLUDE OR EXEC)
-DEFAULTS &TSCOMID = '?';
-DEFAULTS &SESID = '?';
-SET &V = TEMPPATH (255, 'A255');
-SET &L = ARGLEN (255, &V ,'I3');
-SET &F = 'A' || &L;
-SET &V = TEMPPATH (&L , '&F.EVAL');
-SET &EDATEMP = &V ;
-SET &P = POSIT ( '&EDATEMP.EVAL' , &L , 'ts0' , 3 , 'I2');
-SET &TSCOMID = SUBSTR (&L , '&EDATEMP.EVAL' , &P , &P + 7 , 8 , 'A8');
-SET &TS1 = EDIT (&TSCOMID ,'$$999999');
-SET &TS2 = TRIM ( L , &TS1 , 6 , '0' , 1 , 'A6' );
-SET &L = ARGLEN ( 6 , &TS2 ,'I3');
-SET &F = 'A' || &L;
-SET &TSNUM = SUBSTR ( 6 , '&TS2.EVAL', 1 , &L , &L , '&F.EVAL');
-SET &TIME = EDIT ('&TOD.EVAL','99$:99$:99');
FILEDEF EDAPRINT DISK D:\ibi\srv53\wfs\edaprint.log
-RUN
-*=======
DEFINE FILE EDAPRINT
-*=======
SDATE /A10 = GETTOK (F1, 150, 1, ' ', 10 , 'A10') ;
STMST /A8 = GETTOK (F1, 150, 2, ' ', 8 , 'A8' ) ;
SESID /A8 = GETTOK (F1, 150, -1, '=', 8 , 'A8' ) ;
END
-*=======
TABLEF FILE EDAPRINT
-*=======
PRINT SESID
WHERE F1 CONTAINS 'connecting'
AND F1 CONTAINS 'sesid='
AND F1 CONTAINS 'tscomid=&TSNUM.EVAL'
AND SDATE EQ '&DATEMDYY.EVAL'
AND STMST EQ '&TIME.EVAL'
ON TABLE SAVE AS SVRID FORMAT ALPHA
END
-RUN
-IF &LINES EQ 0 THEN GOTO NOSESID;
-READ SVRID &SESID.A8.
-RUN
-NOSESID
-TYPE tscomid=&TSCOMID , sesid=&SESID
Regards,
Michel
WF 8.1.05M/8.2.06,CentOs,Windows,Oracle ,Postgress