based on above results(derived from sortout(file) results),Now I need to add 2 more output files(in this same step), if I see spaces in 1st 20 character(1,20,CH,EQ,C' ') of OUTPUT.FILE1 need to write output file2 and if there is no spaces(1,20,CH,NE,C' ') need to write output file3
Thanks in advance
CODED and moved to the correct forum, please bear this in mind in the future
Joined: 06 Sep 2006 Posts: 40 Location: United States
I tried below option with 'INCLUDE/OUTFIL' , am getting desired result in sortout file but empty on both output File1/ File2 , challenge here is need to derive File1 and File2 upon result from sortout file
This should not be a challenge. Since you have given mutually exclusive INCLUDE conditions in your OUTFILs, I would expect some data in at least one of these output DDs, unless you have used something else in your actual run. BTW are you using SORTOF01 and SORTOF02 DDs?
How about posting here the complete JCL and control statements from your actual run. While posting code/sample data, Select the content, Click the 'Code' button in the editor, and Preview it to make sure it looks good, before posting.
You have an embedded comment line '//*' in your SYSIN card which I think 'helps' DFSORT IGNORE your OUTFILs (explains your empty SORTOF* outputs)
Have you looked at your SYSOUT yet? I would suggest you start doing that before coming to the forums.
btw, are you still having trouble using the Code button here?
Joined: 09 Mar 2011 Posts: 7311 Location: Inside the Matrix
If you look at the SYSOUT from you step, you'll see your OUTFILS do not even appear. If you look around further (like file 2 of the spool output for your JOB) you'll find an unnumbered //SYSIN DD * statement saying "GENERATED STATEMENT".
You can't have random cards in a JOB-deck which are not JCL and not data-cards, so if JES finds that situation, it generates the DD statement that you have "forgotten".
If you want to separate parts of your code with comment lines, have an "*" ads the first character. Entirely blank lines are also fine. What you can't do is use a JCL comment, because the input stream is ended by the first JCL statement that it is en, or by "/*" or (for SORT) by an " END".
We could guess your issue, not necessarily its exact form, because you had OUTFILs with apparently mutually-exclusive conditions. The only way both could be empty would be if your input was empty.
You should also look at SAVE on OUTFIL. SAVE says "write here anything which has not appeared on any other OUTFIL". It is like an "ELSE" for OUTFIL INCLUDE/OMIT. Saves you coding negated conditions or entire sets of conditions which are mutually exclusive.
On Code button, as you mentioned earlier I've used that while posting this. but I don't know still if you find any issues
Yes, it was not 'coded' correctly. Someone did it for you (see the red note). Like I said, do 'preview' in the future.
if it ignored OUTFIL statement , then how come it would create SORTOF* outputs without any warning or failure ?
DFSORT did not even know about your OUTFILs to issue any error. You can allocate any random data set in your JCL with DDnames - //SORTOF01 //SORTOF02 or //RANDOM or whatever. If you have the allocation parameters right, you will have it created successfully. So there is no question of failure/warning.
On the other hand, if you have a control card with the OUTFIL FILES/FNAMES coded correctly (with no embedded //*), and if you miss the corresponding DDnames in your JCL, then DFSORT will issue an error. Not the other way around.