I'm running batch Java on an IBM mainframe under JZOS. The job creates 0 - 6 ".txt" outputs depending upon what it finds in the database. Then, I need to convert those files from Unix to MVS (ebcdic) and I'm using OCOPY command running under IKJEFT01. However, when a particular output was not created, I get a JCL error and the job ends. I'd like to check for the presence or absence of each file name and set a condition code to control whether the IKJEFT01 steps are executed, but don't know what to use that will access the Unix file pathnames.
I have resolved this issue by writing a COBOL program to check the converted MVS files and set return codes to control the execution of subsequent JCL steps. The completed job is now undergoing user acceptance testing. Perhaps it sounds like a kludge, but it does work and I'm happy to share this solution.
How to check for existence of Unix System Services files
2.2k Views Asked by Mike GH At
1
There are 1 best solutions below
Related Questions in UNIX
- Reading & Writing to the same file from terminal
- `df` command not capturing entire output in perl
- Why is it that when I pass certain directory names to `ls`, sometimes it does not list their contents?
- Detect Mouse Clicks; Terminate Program on Scroll Wheel Movement
- grep expression behaving weird (unix/mac) while reading a conf file
- Unix sub path creation and copy files
- Ignoring folders in The Silver Searcher `ag`
- struct nameidata-Linux Kernel Module
- telegraf service not able to retrieve data using the journalctl commands
- Order of options in Unix sed for editing files in-place
- Trying to echo line variable along with another variable inside a while read loop
- failed to handshake with xxx: authentication error?
- UDP socket client not able to receive data
- Invalid SCA token in unix
- How can I keep randomized UNIX timestamp in specific hour range in SQL?
Related Questions in ZOS
- Z/OS Cobol 6.3 copy: how to include only a chunk?
- Using the 'Download ZIP' option on Github Rep with z/OS?
- How to "stack" an ISPF command?
- How to use LISTDSI under OMVS
- Can I use an EQU in z/OS HL/ASM for a value in a DC?
- How do I package a object module replacement for distribution via smpe
- Trying to OPEN a PDSE and write records to a new member using z/OS HL/ASM
- How to programmatically overwrite DCI 2.0 policy via REXX or JCL?
- Connect to Db2 on z/OS from Windows. Connection failed due to a license error
- BPX2OPN fails when trying to open existing file for read/stat
- How do I write current date and time to a sequential dataset using JCL?
- How do I get the parameters passed in to an assembler program running in the UNIX System Services environment on z/OS?
- Compehending fields: ALLOC, FREE and %FR in FDReport product from BMC for mainframe
- zsh associative array has multiple keys with the same value
- U4091 Reason 00000006
Related Questions in JCL
- Mainframe Programming Sorting, OUTFIL REMOVECC,NODETAIL
- What are JCL Alternitives for Embeded Applications?
- Do I need delimiters on Dataset names for IDCAMS ALTER?
- How do i automate the JCL
- How to process non formatted numeric variable from SYSIN DD from JCL in COBOL
- How to programmatically overwrite DCI 2.0 policy via REXX or JCL?
- Sorting in JCL or COBOL
- How do I write current date and time to a sequential dataset using JCL?
- Replace using Sort in JCL
- I have a VB file of varying record length. I want to convert it in FB file
- Hi there, I am very new to mainframe and JCL, and I need some help understanding what this means/what I have to do
- Is a RECFM=VB dataset required to have a BDW?
- Update the trailer counts using JCL
- MVS ALLOCATE DDNAME to apply to multiple jobs
- Execute multiple JCL job with same name simultaneously
Related Questions in MVS
- PDF doc displayed in browser in ASP.NET Core MVC app has blank pages
- MVS ALLOCATE DDNAME to apply to multiple jobs
- On z/OS USS, how to decide whether an existing MVS data set is a partition data set (library) or a sequential data set?
- how to make routing in javascript express
- wxWidgets LNK1104 error when linking Statically in MVS and c++
- I am getting error in IBM Mainframe "DATA SET HELLO.SUYASH.TEST1 NOT ALLOCATED, REQUEST CANCELED"
- Using WTO to write multi-line message via __asm__ in C language
- How to cancel a JCL job(Mainframe) in SDSF???(OZA1) error
- Moving DataBase from Microsoft SQL folder to App_Data folder (appseting.json)
- Zowe explorer VSCode Retrieving response from zowe.List Error: Huh?
- Run step when previous JCL step did not find file
- z/OS JCL command /*VS command fails when issued in a proc
- How to insert a character when editing a file using ISPF Edit via TN3270?
- Reading EBCDIC variable files with comp-3 without COBOL on MVS?
- Is there a way to check existence of file in MVS before attempting copy to Unix server
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The simplest way to do this in JCL is to use BPXBATCH as follows:
If the file exists, the step ends with CC 0 and the
IFsucceeds. If the file does not exist, you get a non-zero CC (256, I believe), and theIFfails.Since there is no
//STDOUT DDstatement, there's no output written to JES.The only drawback is that it is another job step, and if you have a lot of procs (like a compile/assemble job), you can run into the 255 step limit.