FOCUS -- Data file handling with empty files.

We have a generic problem when FOCUS comes up with 0 records; this is
possible in hundreds of FOCUS execs and we are trying to find a way fix
this in the JCL. Zero records causes a problem with one of the outboard
processors where reports are stored. One attempt, which will work but
is cumbersome, is to insert a REXX exec step just before the FTP step
and look thru the files to see if any are empty and if an empty file is
found, insert some records into it from rexx. This can be made to work
but is complicated; So I tried the following -- before the FOCUS step,
insert a copy of the files used by FOCUS for reports which contains
dummy records indicating an empty report -- hoping that if the FOCUS
exec found no records these dummy records would be FTP'd outboard but if
FOCUS exec had records they would overlay the dummy records. But when
FOCUS comes up with Zero records, it overlays the dummy records and in
effect empties the file...
I know this may seem strange but this problem really plagues us -- Maybe
some one has found a solution.
Thnx
Bob Hamilton
Eight00 four too four 9 oh 89
A goal without a plan is just a wish. . .

You can check for 0 lines in focus
If you get that drop down to a blank report focexec. I usually use
something like this
define file cars
b1/a40 = "There is no data for this request";
end
table file car
heading
"<b1"
print
model noprint
recordlimit eq 1
end
-run
-exit
I also usually have some &variables that let people know exactly the
request was asking for.
Lawrence Dooley
Vice President
iNautix
(201)413-4588

Bob,
Have you tried adding the
SET EMPTYREPORT = ON
option
Is the problem with the file in the JCL an invalid one for processing?
That may not make sense, anyway, do you have 'DSORG=PS' in the JCL DCB
area?
********************************************** ************************************************************************************************************************************************
Leah D. Cross, MS
Sr. Systems Analyst
Administrative Information Services
email@removed
University of Nebraska at Omaha
6001 Dodge Street, Omaha, NE 68182-0051
Phone: (402)554-3751

FAX:

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

We don't want to go thru 100's of execs adding code. . . The whole
thing is on a short fuse; They are trying to move the processing to
Oracle. I thought if there is a fix in the JCL that would work we could
go with that. . .

well that may be the best answer
One thing I've come to believe in is a standard focexec template with all
this stuff in there.
Then if I need to make a change to the template I can do a global change
with any reasonable editor.

I asked our Storage Management people a year or so ago about something like
that, and all they could come up with was a utility program from a vendor
that would let you see the statistics for a file, but we couldn't figure a
good way to make that cause the JCL to abend or return a return code. What
type of utilities do you have available? If you have Quikjob (Vision:
Report now), Easytrieve or something like that, you could create a proc
that got passed the dataset name after it was supposedly created. The
program could try to open and read the first record on the file, and abend
if it was empty. Based on that return code, the next step could either
copy a dummy file in its place or cause the JCL to skip the FTP step with a
warning of some type. We did something similar when 7.1 changed the rules
for how it set up the DCB for 'empty ' files, which we were previously
concatenating together, but we copied an empty file with the correct LRECL,
etc. in place of the empty file.
Are you intending to do Mainframe Oracle or Unix? We tried mainframe
Oracle about 5 or 6 years ago and it wasn't nearly as, shall we say robust,
as the Unix version. Only a few companies in the world were running it at
that time. I haven't heard anything since then. We've been OK on Unix
Oracle, but the people who run it still don't have as good a notion of a
production system as the mainframe people did. There are still some things
that we did in Focus 20 years ago that aren't so easy to do in Oracle-land
without a bunch of additional software (to be fair, the mainframe took a
lot of additional software, too, but we already had it there, but we've
been reluctant to spend enough money on the necessary utilities and
infrastructure). Have fun on Oracle. As one of the directors said when
they wanted to switch "well it's going to be a lot of learning and rework
to switch, but it sure looks better on your resume!"
.
Ron

We don't want to go thru 100's of execs adding code. . . The whole
thing is on a short fuse; They are trying to move the processing to
Oracle. I thought if there is a fix in the JCL that would work we could
go with that. . .
bobh

If they're .FOC files or can be made so, you can use USE. I have alsoaccomplished it by SAVEing the two files, APPENDing them to a newfilename, creating an MFD under the same name, and finally FILEDEFingit all together for further processing.
Dave Perry
Rider University

I assume that you are talking about hold files aka flat files
Here's the way to do it
You have two flat files out there

hold1.ftm and hold2.ftm there are
also two master files hold1.mas hold2.mas
first use the os concatentate the files
The do a -run to make sure WebFOCUS executes it (I'm a big beliver in
using -RUN to force webfocus to do things when I want)
Now lets' assume that you concatenated them into hold1.ftm
Now hold1.mas can be used to read the file however just to make sure do a
filedef

fi hold1 disk hold1.ftm
-run
now WebFOCUS will definitely associate hold1.mas with hold1.ftm normally
it should any way this just makes sure that the concatenation didn't cause
any problems - I may be paranoid about this but after 20 plus years
working with this stuff it works so i keep doing it.
Note with the filedef (old vm/cms format and the old vm/cms command (focus
was developed on vm/cms so that's why) for an internall dd statement for
those JCL people out there) you can have any name on the actual data
Here's the key make sure that hold files are exactly but exactly the same
each field is the same type and same size or else this won't work. best
way to test this is bring the two files down to disk and do a copy to a
permanent directory on the server where you can look at them.

Remember you can shell to the OS any time in a fex to do just about
anything.

You can run an OS command or even run a custom program (the OS
just needs to be able to find it). You want to run a script that needs to
reference files in the temporarty directory just leave all of tha stuff
blank in the script and at the start of the fex use the OS to copy the
script into the directory (in dos this would be copy
c:\scripts\scriptname.extension *.*) Do a -run to make sure it happens
then execute it with a dos scriptname.extension followed by a -run
hope that helps.

If you create separate MFDs for each file, with the fields given the
same name, you can use the MORE command to merge the outputs together,
without going to extra steps.

On the other hand, if you want help resolving WHY what you're doing
doesn't work, providing the procedure and MFDs would be a good start, as
well as saying HOW it doesn't work. Do you get an error; do you get the
wrong number of records, etc.

I STILL cannot get two files concatenated. I know I could do it with
Punched Cards but not with electrons. Isn't that something.

I tried match . . . OLD-OR-NEW and I cannot see why that would not
concatenate the two files. But it doesn't. This has got the books
out-of-balance and we cannot find the problem.
Hope someone can help.

Thnx- It's getting late here. I have two files - one with 2273 records
and one with 19 records for a total of 2292 records with matches; we
should have 2296 matches; so I'm trying to concatenate the two and see
why there is a difference. But I have never had any luck trying to
concatenate two or more files in FOCUS.

We have resorted to saving the files in datasets and concatenating them
in JCL then dealing with the problem. But in this situation we cannot do
that.

Having looked through this thread, I've found if trying to match and you
want everything to show, you almost have to do a BY on the majority of the
fields that are in common between the two files and do the old-or-new
option. Might help to see your match process.
********************************************** ************************************************************************************************************************************************
Leah D. Cross, MS
Sr. Systems Analyst
Administrative Information Services
email@removed
University of Nebraska at Omaha
6001 Dodge Street, Omaha, NE 68182-0051
Phone: (402)554-3751

FAX:

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

WHERE SW010_SWAP EQ '2008'
AND ( (SW025 IS-FROM '81007' TO '81917') OR
(SW025 IS-FROM '83406' TO '83447')
OR
SW025 IN FILE F1307Y08 )
The IS-FROMS work but the IN FILE is ignored....

Okay, with out a closing parenthesis on the last in file and that might be
a cut paste issue on your part. So if there is a second right parenthesis
on the IN FILE statement that would make the entire 'OR's' checkable,
However, I found one time that if a first OR was satisfied, others were
ignored. So I would fully parenthesis and see what happens. It was if
from one version to the next the system stopped working.
Have you had any upgrades?
********************************************** ************************************************************************************************************************************************
Leah D. Cross, MS
Sr. Systems Analyst
Administrative Information Services
email@removed
University of Nebraska at Omaha
6001 Dodge Street, Omaha, NE 68182-0051
Phone: (402)554-3751

FAX:

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

Glad it works. Interpretive languages like FOCUS sometime have issues
with where statements. I spent days trying to figure out why a fex kept
crashing on our WebFOCUS server and it turned out to be the where clause.
Ah well on to the next.
********************************************** ************************************************************************************************************************************************
Leah D. Cross, MS
Sr. Systems Analyst
Administrative Information Services
email@removed
University of Nebraska at Omaha
6001 Dodge Street, Omaha, NE 68182-0051
Phone: (402)554-3751

FAX:

(402)554-3475
********************************************** ************************************************************************************************************************************************
NOTICE: The information in this e-mail and any files attached are
intended only for the addressee and may contain confidential or privileged
material or work product. Any interception, review, re-transmission,
dissemination, or other use of this information by persons or entities
other than the intended recipient is expressly prohibited. If you believe
you have received this communication in error, please notify the sender by
return e-mail or notify the sender at the above telephone number.
********************************************** ************************************************************************************************************************************************
Live Long and Prosper
********************************************** ************************************************************************************************************************************************

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.