RPGIV编程技巧(5)用RPGIV完成每30分钟提交一个作业,codes
D sleep PR 10I 0 ExtProc('sleep')
D 10U 0 Value
D spawn PR extproc('spawn')
D path * value options(*string)
D fd_count 10I 0 value
D fd_map 10I 0 dim(256) options(*varsize:*omit)
D inherit likeds(inheritance_t)
D arguments * dim(SPAWN_MAX_NUM_ARGS)
D options(*varsize)
D envvar * dim(256) options(*varsize)
/Free
Dow %Shtdn = *Off;
// wait 30 minutes
Sleep(1800);
// spawn a new job to run the program that must be called every
// 30 minutes. Processing does not wait for the program in the
// threaded job to end.
Path = '/QSYS.LIB/MYLIB.LIB/MYPGM.PGM';
ThreadedJobID = spawn(path: 0: *OMIT: inherit: arguments: envvar);
EndDo;
/End-Free
阅读(1584) | 评论(2) | 转发(0) |