Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
S3 Customization/Development
900-submit-job blocking?
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Jessica
Past 24 Hours:
2
Prev. 24 Hours:
0
Overall:
5164
People Online:
Visitors:
255
Members:
0
Total:
255
Online Now:
New Topics
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1348
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
S3 Customization/Development
900-submit-job blocking?
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Chris
Basic Member
Posts: 8
8/29/2011 5:55 PM
FYI - new to lawson, so learning the ropes.
I'm writing a COBOL program to read in 1 or more files and for each file, kick of a batch job, of another program, that I defined via jobdef. Since each file will be processed by the same job, my thought was to copy using the work file, using 900-movefiles, to a working directory and file-name that I defined in the job-def, and then use 900-load, 900-create, and 900-submit to run the job, and then when the job was over, repeat the process for each of the files that might exist...hope that all makes sense.
My issue, however, would be if the 900-submit call is not blocking and my COBOL program would not know when the job ends, which would result in my code overwriting each of the previous submitted job's workfiles (which I moved into place with the previous 'loop').
Can anyone confirm whether the 900-submit-job call is blocking or not? NOTE: according to the API, I saw the 900-create-and-submit was not blocking.
If 900-submit is not blocking, anyone have another idea how to submit the same job multiple times on different files like I'm trying to do?
Thanks!
-Chris
John Henley
Senior Member
Posts: 3348
8/29/2011 6:58 PM
900-SUBMIT will just submit to the job queue and has no knowledge of the job's completion, etc.
If you know how many files there are, and it doesn't change, you can create a multi-step job using jobdef that runs your cobol program as many times as needed for the various files. If you don't know until run-time, you could create a new job for each file, passing/setting the input file location/name as one of the job parameters.
Chris
Basic Member
Posts: 8
8/31/2011 11:19 AM
Hi John,
Thanks for confirming what I suspected. So I'm onto the next options -- you mentioned setting the input file as a parameter, which is what I'd like to do. I've figured how to create a job, set the jobreq parameters and the few jobstep parameters, but none of the parameters appear to be related to the inputfile. My program is going to create multiple jobs (unknown how many each run) for Lawson's PR530. Is there a way to not touch PR530 and set the inputfile directory/path as a parameter without touching PR530?
Thanks again!
-Chris
Sampath S
Basic Member
Posts: 17
9/30/2011 8:05 AM
Hi Chris,
You can create a UNIX script and submit multiple jobs for the same program. Here is the sample script which you build;
1. Check if the input file is avilable and if present then copy file-1 into some backup folder and then as defined below submit the job and for any errors it will send an email to you and exit from the script.
2. Similarly you can submit submit same program for other files.
3. Always check if the file is present in the respective and then go for further processing.
export B3="/$LAWDIR/prod/work/FILENAME"
export B2="/$LAWDIR/prod/work/BACKUP"
if [ -f $B3/FILE-1 ]
then
cp $B3/FILE-1K $B2/FILE-1.$(date +%m%d%y)
echo 'File Archieved and Copied successfully
fi
wtsubmit -n lawson-user-name job-id
jqstatus -w | grep -i "needs recovery" | grep -i "program-id" > ErrFile
if [ -s ErrFile ]
then
cat ErrFile | mail -s "program-id in Needs Recovery" $chris@aaa.com
echo 'program-id job in needs recovery'
fi
exit
You are not authorized to post a reply.