IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to handle empty file in Jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Tue Sep 27, 2011 3:57 pm
Reply with quote

I have a question, can the empty file is treated as a record in a job?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 27, 2011 4:01 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Sep 27, 2011 5:38 pm
Reply with quote

@sivasaras

Sir, what the hell is a record in a job ???
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Sep 27, 2011 6:02 pm
Reply with quote

A file is never a record. Find a dictionary.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 27, 2011 6:12 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 27, 2011 6:25 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 27, 2011 6:34 pm
Reply with quote

That must be close to a record, even a 78. Was the seat still warm when you arrived Robert?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Sep 27, 2011 6:36 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 27, 2011 10:42 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Sep 27, 2011 11:18 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 01, 2011 2:16 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 01, 2011 2:40 am
Reply with quote

Quote:
Missing, presumed fed?

icon_lol.gif I liked that, AKA. Very punny!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 01, 2011 10:47 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 01, 2011 12:25 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 01, 2011 1:23 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 01, 2011 10:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 01, 2011 10:48 pm
Reply with quote

Well Jack ! I guess Your question will go unanswered icon_biggrin.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 02, 2011 5:12 am
Reply with quote

I guess sivasaras has left the building.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 08, 2011 12:07 am
Reply with quote

topic locked due to TS disappearance
will be deleted in a couple of days
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top