View previous topic :: View next topic
|
Author |
Message |
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
I have a question, can the empty file is treated as a record in a job? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
No.
I'm guessing that is not your real question with all the information that would allow us to provide some sort of reasonable answer.
If you can come up with a better way to phrase your question, with all the information we need, maybe the answer is different. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@sivasaras
Sir, what the hell is a record in a job ??? |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
A file is never a record. Find a dictionary. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
A very, very, very, very, enormously big file might be a record, eh Ph..., er, Phil?
Edit: Having taken up the space for a joke, no need for another post...
And to answer UmeySan, for some, maybe only a couple of days. Seen that. Guy believed the interviewer's description of the development environment. First day he thought he must have come to the wrong company by accident, except he was expected. Second day calling agencies. Third day... well, there wasn't one :-) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I worked a contract in Mississippi one time where they were still talking about someone who came in Monday morning, left for lunch at noon, and never came back. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That must be close to a record, even a 78. Was the seat still warm when you arrived Robert? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
I have a question, can the empty file is treated as a record in a job? |
the question as posed does not make too much sense.
a properly designed application should run <properly> even when <one> of the input files is empty/does not contain any record |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
A proper "empty" file (correct dcb info and an eof marker) will process as a file with zero records. I have no idea how this might be "treated as a record" - 'cause there is no record. . . |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Robert Sample wrote: |
I worked a contract in Mississippi one time where they were still talking about someone who came in Monday morning, left for lunch at noon, and never came back. |
Missing, presumed fed? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi sivasaras,
Why don't you tell us what you would like the progam to do if there was no data in that file. It might help generate a few suggestions for you. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Quote: |
Missing, presumed fed? |
I liked that, AKA. Very punny! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Why don't you tell us what you would like the progam to do if there was no data in that file. |
it depends on the application..
a long time ago in Italy the daily journal for some financial transaction
( IIRC accounts receivable and payable )
had to be printed on continuos/fanfold paper each sheet tax stamped and numbered by the IRS/VAT office
the procedure was supposed to run for every working day
it means taht the program had to be able to run with an empty transaction file
producing the usual report but just with headers,trailers ( dates and totals )
in my experience I found generally more effective to write programs to produce a <auditable> result also with empty files
easier to plan for a procedure to run on calendar basis
rather than go thru the hassle of checking the status of some dataset. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I like the "This Page Intentionally Left Blank" technique.
If a file always has a file-header and file-trailer, the file is never "physically empty" except in "abnormal" circumstances where the obvious thing is an "abnormal end" so you can find where something has gone wrong.
The header always has business date in, and "logical file name" at the very least.
The trailer always has count of data records and some hash totals (at least one per record-type).
The file is always "in sequence". File header/trailer/data id/key are in the same place, so can always be reliably identified.
Program reading file checks for: first record is header; header is correct logical file name; header is correct business date (business date being found from a piece of data on DASD somewhere which has that sole purpose, and which is updated first thing in the batch each day - and not by just moving the damn run-date to it!); subsequent records are data or trailer; file is in sequence; trailer is present, record count and hash totals are correct; no records appear after the trailer.
Every single program has that sort of logic in, along with other tedious stuff like run-totals (reads per file, updates, changes, totals by record-types per file, that sort of thing). Checking IO status, another boring thing, tough to code out every time.
Get everything jammed in the program - oh, don't just jam it in, make it look nice, meaningful, understanable, self-documenting.
Every program. Every time.
Why? 'Cos if you have all this, you're going to save yourself so much damn time when you make a stupid coding error.
Plus, you are always able to produce the "empty report" (This Page Intentionally Left Blank) and any "empty" output files. Saves the Print Distribution people spending an hour looking for a missing repost, the user raising a fault for "I can't find XYZ for 23rd April" (fault arrives in first week of July).
Plus if you do end up with an "empty" empty file, you know something is seriously wrong, not just "well, could be OK, let's carry on anyway".
How to deal with an empty file? Don't have 'em. If you do, abend, double-quick. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Now, isn't that a lot to always have to put in a program? Very tiring, all that typing.
If you wrote every line from scratch, maybe it would be, but no-one is that dumb are they?
Learn the editor's capabilities. Know what is there, and look it up until you know it yourself. Learn the macro language's capabilities. Know what is there, and look it up until you know it yourself. If something is close to what you want - copy it. See earlier in this paragraph. NEVER FORGET TO CHANGE EVERYTHING THAT IS NECESSARY AFTER COPYING.. See earlier in this paragraph, but after the other "See earlier...".
If you like, this is the "lazy" way to program. Invest your time to save you time later. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Quote: |
it depends on the application.. |
That's why I asked the ques:
Quote: |
Why don't you tell us what you would like the progam to do if there was no data in that file |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Well Jack ! I guess Your question will go unanswered |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I guess sivasaras has left the building. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
topic locked due to TS disappearance
will be deleted in a couple of days |
|
Back to top |
|
|
|