IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

batch SFTP job using AOPBATCH unable to write to MVS dataset


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
BlackScreen_Hustle

New User


Joined: 20 May 2024
Posts: 12
Location: India

PostPosted: Sat Oct 05, 2024 10:28 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Sun Oct 06, 2024 9:08 am
Reply with quote

Show us the JCL
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Sun Oct 06, 2024 10:36 am
Reply with quote

Also try BPXBATCH first instead of the AOPBATCH program. Check for the correct syntax.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Mon Oct 07, 2024 9:11 am
Reply with quote

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
View user's profile Send private message
BlackScreen_Hustle

New User


Joined: 20 May 2024
Posts: 12
Location: India

PostPosted: Mon Oct 07, 2024 5:18 pm
Reply with quote

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... icon_sad.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Mon Oct 07, 2024 6:19 pm
Reply with quote

W/o JCL this discussion is quite senseless.
Back to top
View user's profile Send private message
BlackScreen_Hustle

New User


Joined: 20 May 2024
Posts: 12
Location: India

PostPosted: Mon Oct 07, 2024 6:21 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2131
Location: USA

PostPosted: Mon Oct 07, 2024 7:15 pm
Reply with quote

FYI: (RTFM)

Copying data between the z/OS UNIX file system and MVS data sets
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts BPXBATCH SFTP to remote path having s... All Other Mainframe Topics 6
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
Search our Forums:

Back to Top