Hi Gayle,
I had waited to see if anyone else had a response to this before offering mine (which is incomplete and "half-baked"). My direction was to explore writing a process scheduler entry from SQR, from which the Process Scheduler Batch Server would then take over and run the cobol. I couldn't find a way to directly call the cobol (being totally ignorant of that language), although there may perhaps be enough clues inside Config Manager.
I found a process scheduler request for a cobol process in psprcsrqst and from that devised how I could insert a row into that table (example follows). The SQR could gather the various pieces of information, build the insert statement and execute it. Then the server could take over from there...
Bob
Example:
Let $SQL = 'insert into psprcsrqst '
Let $SQL = $SQL || '(PRCSINSTANCE,JOBINSTANCE,PRCSJOBSEQ,PRCSJOBNAME,PRCSTYPE,'
Let $SQL = $SQL || 'PRCSNAME,RUNLOCATION,OPSYS,DBTYPE,DBNAME,'
Let $SQL = $SQL || 'SERVERNAMERQST,SERVERNAMERUN,'
Let $SQL = $SQL || 'PRCSCLASS,RUNDTTM,RECURNAME,'
Let $SQL = $SQL || 'PARMLIST,'
Let $SQL = $SQL || 'WORKINGDIR,CMDLINE,'
Let $SQL = $SQL || 'OUTDEST,OPRID,PSWD,ACCESSPSWDTGT,'
Let $SQL = $SQL || 'PRCSPRTY,PRCSVERSION,SESSIONID,RUNSTATUS,RQSTDTTM,'
Let $SQL = $SQL || 'LASTUPDDTTM,BEGINDTTM,'
Let $SQL = $SQL || 'ENDDTTM,RUNCNTLID,PRCSRTNCD,MSGSET,MSGNUM,'
Let $SQL = $SQL || 'MSGPARM1,MSGPARM2,MSGPARM3,MSGPARM4,MSGPARM5,'
Let $SQL = $SQL || 'CONTINUEJOB,USERNOTIFIED,INITIATEDNEXT,'
Let $SQL = $SQL || 'OUTDESTTYPE,ORIGPRCSINSTANCE,GENPRCSTYPE,ORIGPARMLIST,RESTARTENABLED) '
Let $SQL = $SQL || 'values (448,0,0,'''',''COBOL SQL'','
Let $SQL = $SQL || '''PSPPYBLD'',1,1,7,''HRPLAY2'','''','''','
Let $SQL = $SQL || '''COBOL SQL'',''8/26/99 2:57 PM'','''','
Let $SQL = $SQL || '''MICROSFT/HRPLAY2/PS/%OPRPSWD%/1/448'','
Let $SQL = $SQL || '''c:\mssql7\binn'',''s:\hr751\cblbin\PSPPYBLD.EXE'','
Let $SQL = $SQL || '''C:\TEMP\'',''PS'',''0000000000000000'',''0000000000000000'','
Let $SQL = $SQL || '9,0,''210495-'',9,''8/26/99 2:59 PM'','
Let $SQL = $SQL || '''8/26/99 2:59 PM'',''8/26/99 2:59 PM'','
Let $SQL = $SQL || '''8/26/99 2:59 PM'',1,0,65,35,'''','''','''','''','''',0,0,0,'
Let $SQL = $SQL || '2,448,2,''MICROSFT/HRPLAY2/PS/%OPRPSWD%/1/448'',0)'
BEGIN-SQL
[$SQL]
END-SQL
-----Original Message-----
From: Gayle.Hook [mailto:Gayle.Hook@YELLOWCORP.COM]
Sent: Monday, November 22, 1999 5:04 PM
To: Multiple recipients of list SQR-USERS
Subject: Calling COBOL from SQR
Hi All,
I'm using SQR v 4.3.2, PeopleTools 7.56, Oracle 8, Sun, NT workstation.
Does anyone know if there is a peoplesoft function that can be called to get
the next process instance number within a SQR program... I'm trying to Call
a COBOL Program from a SQR using the process scheduler with the 'Call System
using' command. I am using a select with in the SQR to get my parms to pass
to the COBOL. I have a need to execute the COBOL program in a batch that is
why I have chosen this method. I want to get the next process instance #
that is available, then within my program assign that number to the COBOL
process that I'm calling from the command line. I do have my SQR calling
the COBOL for 6 instances (using a loop) and it is working but I'm
hardcoding the starting value.
Each time I run I have to change the start value as NOT to get a 00805
ORA-00001unique constraint error.
I would be interested in getting anyones help especially if you have a SQR
program calling COBOL.
THANKS!!!
Gayle A Hook
Programmer Analyst II
(913) 344-3729
Gayle.Hook@yellowcorp.com