Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, Is it possible to control the output files from a COBOL programs? I've a requirement where I will have to produce the output file (a report) only on Fridays in a year. How to get it done? We are using "IBM Enterprise COBOL for z/OS and OS/390 3.2.0" Please help.
Post Follow-up to this message"arrbee" <arrbee@gmail.com> wrote in message news:1145604671.952859.159440@v46g2000cwv.googlegroups.com... > Hi, > > Is it possible to control the output files from a COBOL programs? I've > a requirement where I will have to produce the output file (a report) > only on Fridays in a year. > > How to get it done? We are using "IBM Enterprise COBOL for z/OS and > OS/390 3.2.0" Maybe using something like this. 01 d-o-w pic 9. 88 friday value 5. accept d-o-w from day-of-wif friday perform produce-report end-if Unless you are looking for a solution using JCL or job scheduling. In which case, I will defer to others.
Post Follow-up to this messageThere are also several other "COBOL language" options - depending upon exact ly WHAT you are looking for. Certainly, if you are looking for a way to "dynamically allocate" the file ( only on Fridays) then you would want to look at the "dynamic file allocation" information available with Enterprise COBOL. -- Bill Klein wmklein <at> ix.netcom.com "Rick Smith" <ricksmith@mfi.net> wrote in message news:124h4ca8bpmba9b@corp.supernews.com... > > "arrbee" <arrbee@gmail.com> wrote in message > news:1145604671.952859.159440@v46g2000cwv.googlegroups.com... > > Maybe using something like this. > > 01 d-o-w pic 9. > 88 friday value 5. > > accept d-o-w from day-of-w> if friday > perform produce-report > end-if > > Unless you are looking for a solution using JCL or > job scheduling. In which case, I will defer to others. > > >
Post Follow-up to this messageHi Rick, Thank you very much. I want to achieve it programatically. Of course, we eventually execute JCL with this program load module........:-)
Post Follow-up to this messagearrbee wrote: > Hi, > > Is it possible to control the output files from a COBOL programs? I've > a requirement where I will have to produce the output file (a report) > only on Fridays in a year. > > How to get it done? We are using "IBM Enterprise COBOL for z/OS and > OS/390 3.2.0" > > Please help. Produce the file every day and tell the end-user to access the file only on Fridays. This technique transfers ownership of the problem to someone else.
Post Follow-up to this messagearrbee wrote: > Hi, > > Is it possible to control the output files from a COBOL programs? I've > a requirement where I will have to produce the output file (a report) > only on Fridays in a year. > > How to get it done? We are using "IBM Enterprise COBOL for z/OS and > OS/390 3.2.0" > > Please help. > All output from Cobol is controled by Cobol programs, yes. If you only want to get the report on Fridays, I'd suggest that you only run it on fridays. Few programs will do anything if you do not run them. Failing that, have the program check the date to see if it is Friday, and bypass the report if it is not. Donald
Post Follow-up to this messageOn 21 Apr 2006 00:31:12 -0700, "arrbee" <arrbee@gmail.com> enlightened us: >Hi, > >Is it possible to control the output files from a COBOL programs? I've >a requirement where I will have to produce the output file (a report) >only on Fridays in a year. > >How to get it done? We are using "IBM Enterprise COBOL for z/OS and >OS/390 3.2.0" > >Please help. Use a date routine to determine what "today" is. If Friday, produce report, otherwise end. Regards, //// (o o) -oOO--(_)--OOo- "Do stars clean themselves with meteor showers?" -- George Carlin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Remove nospam to email me. Steve
Post Follow-up to this messageOn Fri, 21 Apr 2006 08:46:26 -0500, "HeyBub" <heybubNOSPAM@gmail.com> enlightened us: >arrbee wrote: > >Produce the file every day and tell the end-user to access the file only on >Fridays. > >This technique transfers ownership of the problem to someone else. > And this solution will not gain you any friends within your user organization. Regards, //// (o o) -oOO--(_)--OOo- "Do stars clean themselves with meteor showers?" -- George Carlin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Remove nospam to email me. Steve
Post Follow-up to this messageIn article <124h4ca8bpmba9b@corp.supernews.com>, Rick Smith <ricksmith@mfi.net> wrote: > >"arrbee" <arrbee@gmail.com> wrote in message >news:1145604671.952859.159440@v46g2000cwv.googlegroups.com... > >Maybe using something like this. > > 01 d-o-w pic 9. > 88 friday value 5. > > accept d-o-w from day-of-w> if friday > perform produce-report > end-if The advantage of this solution is that it allows for a tendency for report results to be demanded with increasing frequency... annuals become quarterlies, quarterlies become w
lies, w
lies become dailies and dailies become ad-hocs. To modify the abovegiven example for future use one might use something along the lines of: 01 d-o-w pic 9. 88 monday value 1. 88 tuesday value 2. 88 wednesday value 3. 88 thursday value 4. 88 friday value 5. 88 saturday value 6. 88 sunday value 7. 88 report-needed-today values 5. ... accept d-o-w from day-of-w
. evaluate true when report-needed-today perform produce-report-ritual thru prr-ex end-evaluate. ... produce-report-ritual. evaluate true when friday perform produce-friday-report thru pfr-ex when other perform report-error-ritual thru rer-ex go to blow-up-program end-evaluate ... et and cetera. This way when - *not* 'if' - a user says 'Well, on Thursday we'll want Tuesday's report... but broken down by division, not department, and including the miscellaneous graft and corruption figures and sorted on descending barometric pressure'... or something like that... the values clause for report-needed-today gets changed, the evaluate in produce-report-ritual gets expanded and, as BritSpeakers sometimes say, your mother's brother's name is Robert. (note that perform thru and go to constructs are used because they are, inarguably, the best possible styles available... and I, of course, am the King of England) DD
Post Follow-up to this message> I will have to produce the output file (a report) > only on Fridays in a year. Except on Easter wwhen it is to be done on Thurday ? And, if Christamas day is Friday, then do it Wednesday ? And, for ThanksGiving ...
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.