View previous topic :: View next topic
|
Author |
Message |
BlackScreen_Hustle
New User
Joined: 20 May 2024 Posts: 12 Location: India
|
|
|
|
Hi,
I have a job to receive file from an interface application. My job has these 2 steps -
Step 1 - AOPBATCH
It reads the inbound file from USS and writes the file to a MVS dataset -
!cp unixfile.txt "'//'ABC.DEF.GHIJ'"
Step 2 - ICEGENER
It copies ABC.DEF.GHIJ to a different file
Now the problem is Step 1 is getting an error that it cannot open the MVS file ABC.DEF.GHIJ. The reason is that Step 2 is already holding the file somehow.
I have added a Wait step in between and Step2 is startnig well after Step1 completes. I have also given Cond code in Step2 so that it starts only if it gets RC from Step1, i.e. Step1 finishes. Still the issue remains. If I remove Step2 then my job runs fine. I dont want to move Step2 to a different job, as there are many such jobs and it will take a bulk coding.
Is there a way to make Step2 not hold the file ABC.DEF.GHIJ until Step1 completes ? The problem here is Step2 is holding the file even before it starts executing. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Show us the JCL |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Also try BPXBATCH first instead of the AOPBATCH program. Check for the correct syntax. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Without seeing the JCL, my suggestion would be to add a DD statement for ABC.DEF.GHIJ in the first step.
A simple DD statement should be enough.
Code: |
//myname DD DSN=ABC.DEF.GHIJ,DISP=SHR |
If it still fails, try DISP=OLD
If it is actually a NEW data set, you may need to provide the data set attributes. |
|
Back to top |
|
|
BlackScreen_Hustle
New User
Joined: 20 May 2024 Posts: 12 Location: India
|
|
|
|
Pedro wrote: |
Without seeing the JCL, my suggestion would be to add a DD statement for ABC.DEF.GHIJ in the first step.
A simple DD statement should be enough.
Code: |
//myname DD DSN=ABC.DEF.GHIJ,DISP=SHR |
If it still fails, try DISP=OLD
If it is actually a NEW data set, you may need to provide the data set attributes. |
I have already tried this. Didn't work... Step2 is not recognizing that Step1 needs the file in I/O mode... |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
W/o JCL this discussion is quite senseless. |
|
Back to top |
|
|
BlackScreen_Hustle
New User
Joined: 20 May 2024 Posts: 12 Location: India
|
|
|
|
As a workaround, I have used IKJEFT01. It solves the problem of file open error, but gives a new issue.
//STEP1 EXEC PGM=IKJEFT01
//INHFS DD PATH=/<file path>/<file name>
//OUTDD DD DSN=ABC.DEF.GHIJ,DISP=(NEW,CATLG,CATLG),
// RECFM=VB,.....
//SYSTSIN DD *
OCOPY INDD(INHFS) OUTDD(OUTMVS) TEXT CONVERSION(YES)
My input file in omvs needs to be copied to a VB file. But after running this job whole data comes in one line in ABC.DEF.GHIJ.
input file in omvs -
abcdefghijklmnXopqrstuvwxyzabXcdefghij....
Here X stands for X'0D' which is CR (carriage ctrl).
Output mainfrm file is supposed to be
abcdefghijklmn
opqrstuvwxyzab
cdefghij....
But it comes as -
abcdefghijklmnXopqrstuvwxyzabXcdefghij....
So the OCOPY is not able to handle the carriage ctrl. ANy idea how it can be solved ?
Thanks.
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2131 Location: USA
|
|
Back to top |
|
|
|