My actual requirement is to check for numeric for specific positions and I want only those records with numeric values in the output file.
I think this is possible thru DFSORT, but in our shop we are using Syncsort.
As the same could be achieved thru file-aid, I went for that option;but ended up with RC 8 as I said earlier, whenever the output file is empty.
I have nt forgotten it....I admit that I got the required output (using FILEAID and not thru SYNCSORT) as I had mentioned there.
I am happy with whatever output I am getting with file-aid except the return-code.
And this is a different query by which I wanted to know whether I could change the return-code of batch file-aid.
The closest thing I can find is a table built during installation. There is a field called BTOPT18 that tells File-Aid what return code to use when a file is empty.
Unfortunately, I can't find and references to how to override this option. The manuals don't have an overall index that I can find, and Compuware didn't create a 'bookshelf' PDF file, just individual books with 8 character names.
There is a parm you can pass to FileAid that will override the first 35 installation defaults, including the 18th one that controls what you need. The bad part is that it overalys all characters starting from the left, so you have to provide the values for the first 17 options as well.
So the execute line needs to look like:
Those last two bytes are the return code for an empty file. I tried it and it works. You can put anything from 00 to 99 in there. The other values are the defaults from the manual. In the installation guide, do a find on 'opt=' and you go to the bottom of the list of options.
Well, I have Good News and Bad News. The Good news is that this CAN be overridden. The Bad news is that it is less than straight forward in FileAID.
According to the "File-AID/MVS Installation Guide R8.9" you can modify the Batch FileAID installation options with the following PARM syntax:
// EXEC PGM=FILEAID,PARM='OPT=????????'
The downside is in the format of those question marks. The following is a summarization of the example in the manual.
The first 5 FileAID Batch options are as follows:
BTOPT01, Displacement 00, Default value 0250, Record Print Default
BTOPT02, Displacement 04, Default value 1, Form Print Default
BTOPT03, Displacement 05, Default value 0, Key Print
BTOPT04, Displacement 06, Default value 06, Batch Buffer Space
BTOPT05, Displacement 08, Default value 06, TSO Buffer Space
In order to override the Batch Buffer Space for example, from it's default value of 06 to 12 the Override would look like this:
// EXEC PGM=FILEAID,PARM='OPT=02501012'In other words, you have to specifiy ALL the values to the left of the one you are trying to override! Eww Yuk! And to make matters worse, Ed Goodman is correct that the option you want is BTOPT18. So here are the next 13 installation values from the book:
BTOPT06, Displacement 0A, Default Value 6, PRINTER SPACING.
BTOPT07, Displacement 0B, Default Value 1, CHARACTER SET
BTOPT08, Displacement 0C, Default Value 1, TSO PROMPTING.
BTOPT09, Displacement 0D, Default Value 1, ABEND CONTROL.
BTOPT10, Displacement 0E, Default Value 2, DATE FORMATTING.
BTOPT11, Displacement 0F, Default Value 1, MONTH FORMATTING.
BTOPT12, Displacement 10, Default Value 025, I/O ERROR.
BTOPT13, Displacement 13, Default Value 0, UPDATE OPTION.
BTOPT14, Displacement 14, Default Value 0000, UPDATE ACCESS CODE.
BTOPT15, Displacement 18, Default Value 58, PRINT LINES AT 8LPI.
BTOPT16, Displacement 1A, Default Value 82, PRINT LINES AT 12LPI.
BTOPT17, Displacement 1C, Default Value 1, USER FUNCTION.
BTOPT18, Displacement 1D, Default Value 08, NO RECORDS COPIED RETURN CODE.
The manual says "BTOPT18 specifies the return code that File-AID is to issue when records are not selected for copying to any output dataset in a copy operation. The value 08 reflects the current return code issued. Any number from 00 (issue no return code) through 99 is valid. File-AID always reflects the highest return code issued during an execution."
So assuming your shop took all the FileAID installation defaults, in order to change the return code from 08 to 04 your override would look like:
// EXEC PGM=FILEAID,PARM='OPT=0250100606611121025000005882104'Wow is that ugly or what?