Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to handle empty file in Jcl

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

New User


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

PostPosted: Tue Sep 27, 2011 3:57 pm    Post subject: How to handle empty file in Jcl
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Sep 27, 2011 4:01 pm    Post subject: Reply to: How to handle empty file in Jcl
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: 743
Location: Germany

PostPosted: Tue Sep 27, 2011 5:38 pm    Post subject:
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

Active Member


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

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Sep 27, 2011 6:12 pm    Post subject: Reply to: How to handle empty file in Jcl
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: 7904
Location: Bellevue, IA

PostPosted: Tue Sep 27, 2011 6:25 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Sep 27, 2011 6:34 pm    Post subject: Reply to: How to handle empty file in Jcl
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Sep 27, 2011 6:36 pm    Post subject: Reply to: How to handle empty file in Jcl
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

Site Director


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

PostPosted: Tue Sep 27, 2011 10:42 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Tue Sep 27, 2011 11:18 pm    Post subject:
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    Post subject: Reply to: How to handle empty file in Jcl
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Sat Oct 01, 2011 10:47 am    Post subject: Reply to: How to handle empty file in Jcl
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sat Oct 01, 2011 12:25 pm    Post subject: Reply to: How to handle empty file in Jcl
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sat Oct 01, 2011 1:23 pm    Post subject: Reply to: How to handle empty file in Jcl
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Sat Oct 01, 2011 10:48 pm    Post subject: Reply to: How to handle empty file in Jcl
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Sat Oct 08, 2011 12:07 am    Post subject: Reply to: How to handle empty file in Jcl
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.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us