Posted: Mon Mar 06, 2006 10:39 am Post subject: Date Dependant code in JCL
We have an interface to which we send our files at the end of the day processing (Our system runs on Flat file and no DB2 involved). Now we need to add 8 new fields to our interface file. Our scheduled implementation is July 5th. Where as the scheduled implementation of our interface is August 4th. This calls us for the following situation.
1) Make changes to our programs to generate these new 8 fields.
2) Suppress the 8 fields from the file and send the file in the old format to our partner interface.
3) Starting from August 4th, do not suppress the new fields and send the full file to our interface.
Our conventional approach: We put a lot of date dependant code in the programs to kick off the new fields starting from August 4th onwards. This code after August 4th becomes redundant and I personally feel causing lot of maintenance issues and bulkier code
My suggestion:
Since the number of programs which the file undergoes are more than 10 and these fields under go population and changes across these programs, I suggested not to put date dependant code in programs. Instead want to suppress the fields in the file using utilities like DFSORT.
My Idea is to
1) Generate the file with all the new 8 fields
2) Using DFSORT features of OUTREC, suppress the new fields
3) Using an IF and ELSE condition of JCL (where in I will compare the current date with AUGUST 4, 2006) I will either send the file with suppressed fields or the full file.
I am having problem with point 3 which I mentioned above. I am not so sure how to achieve this. Can this be achieved using any utilities like DFSORT (we are a DFSORT Shop) or Can we use Zeke? ( This I am not so sure what scheduler we use) if so how.
Any help is appreciated
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Mar 06, 2006 11:03 am Post subject:
Quote:
I am having problem with point 3 which I mentioned above. I am not so sure how to achieve this. Can this be achieved using any utilities like DFSORT (we are a DFSORT Shop) or Can we use Zeke? ( This I am not so sure what scheduler we use) if so how.
Any help is appreciated
Novice,
Step 3 is quite easy. We use symnames to dynamically create OUTREC FIELDS depending on the date and use that in the later step to either send the new files or not.
Try this job. I assumed that your file with 8 new fields length is 300 and without the new fields it is 200. So until august 3rd we only send 200 bytes and after that we send 300 bytes.
The first step determines the date using DATE1(YYYYMMDD) and using OUTFIL we create 2 output files(LTAUG04 and GTAUG04). But at any time you will write to 1 output file. And in the next Step we will either chop or retain the new fields.
Thanks for the solution. The same problem had a variation which popped up. The file which we generate has ONE Header record, ONE trailer record and multiple detail records( Detail record has two lay outs).
Header record is identified by 20th Byte as 0(packed decimal)
Trailer record is identified by 20th Byte as 9(packed decimal)
Detail record 1 is identified by 20th Byte as 1(packed decimal)
Detail record 2 is identified by 20th Byte as 2(packed decimal)
The new fields are to be added for Detail record 1 only and rest of the requirements are the same. During this entire operation the Order of the records should not be changed. I am just wondering how to handle this ?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Mar 14, 2006 10:27 am Post subject:
Novice,
You got a solution to your problem within 30 minutes and you never came back and told us if it worked or not. Now after a week you came back once again because you wanted a solution and if we provide the solution you would disappear again.
I guess expecting a feedback for the solutions posted here is too much to ask.
Quote:
The new fields are to be added for Detail record 1 only and rest of the requirements are the same. During this entire operation the Order of the records should not be changed. I am just wondering how to handle this ?
What values do you want the other records(header , trailer detail record 2) to have in the new fields? Spaces or low-values or ????
You got a solution to your problem within 30 minutes and you never came back and told us if it worked or not. Now after a week you came back once again because you wanted a solution and if we provide the solution you would disappear again.
I appreciate the quick response but I couldn't try the solution and hence I am not able to provide any feed back on the same. But when I started trying the solution today, I realized that file has different formats and turned to the Help again.
The other records should be intact as they were before.
The question marks in Detail lay out 1 are the new fields added by reducing the filler at the end to keep the total LRECL as 250. So before August 4th, the file should be
Here is what the approach which I could think off . Separate Header, Trailers into separate files. Generate a unique number for all the existing detail records. Take Detail1 and Detail 2 records into two separate files. Use the solution which you have mentioned earlier for DETAIL1 records. Bring the Detail1 records output and Detail 2 records together and sort them on Unique number and add header and trailer. Is there a better/simple solution than this approach ? Let me know
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Mar 14, 2006 12:46 pm Post subject:
Novice ,
You did not answer my question about the default values for the filler. So I am assuming them as spaces.
I also assumed that you new fields start at pos 200 for a length of 50 bytes.
Quote:
Header record is identified by 20th Byte as 0(packed decimal)
Trailer record is identified by 20th Byte as 9(packed decimal)
Detail record 1 is identified by 20th Byte as 1(packed decimal)
Detail record 2 is identified by 20th Byte as 2(packed decimal)
We create dynamic CHANGE control cards to evaluate detail record 1 at position 20 for 1 which in hex is X'1c'. If the date is less than '20060804' i.e until august 3rd the change card will look this
What values do you want the other records(header , trailer detail record 2) to have in the new fields? Spaces or low-values or ????
The record lay out of DETAIL 1 record is only changed by keeping the LRECL same and by adding new fields and reducing the filler at the end.
That's why I mentioned
Quote:
The other records should be intact as they were before.
I hope the solution is changing only DETAIL 1 records. Please confirm.
Also I do not understand the OUTREC card with Change syntax. I will try to look at the manual first and If i still have questions will get back to you as this syntax is some thing new for me.
With reference you example say if my new fields begin at 225th position(you took them as 41st position in your example) and the length of new fields as 20 bytes, then if I chanhe the corresponding fields, does this suffice ? I tried the following example and I am getting same out put files with current date and tomorrow's date and wondering If I did any thing wrong ?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Mar 15, 2006 10:08 am Post subject:
Quote:
With reference you example say if my new fields begin at 225th position(you took them as 41st position in your example) and the length of new fields as 20 bytes, then if I chanhe the corresponding fields, does this suffice ?
Novice,
yes it would suffice. However you say the newfields is only 20 bytes but in your change card you mentioned 26. I guess one of them was typo
Quote:
I tried the following example and I am getting same out put files with current date and tomorrow's date and wondering If I did any thing wrong
The reason it did not work for you because you have packed decimal field at pos 20 instead of character field. The CHANGE parameter looks for character '1' and it is Not found it will just copy the contents as is. I just used a character field so that you can easily understand.
Change your step0100 control cards to the following. test it with todays date and tommorrow's date
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum