I have a plan code and a sscode lets say plan is 540 and sscode varies from S1 thru S4 like this for each plan there are only 4 sscode that
is S1 thru S4. Plan are 24. So I must split the input file into 96 files for each plan and sscode.
Now before writing any record into these files I should wirte a header record consisting of following fields Plan code, sscode,sum of records of that particula combination), total number of four sscode for that plan. I hope you got it
Now my requirement here is to first count the number of record for a plan and its related sscode. in next step I should count total records for a plan with all sscodes added.
For Eg
Lets say for a plan 540 and sscode S1 i have 100 records Similarly for the same plan and S2 I have 200 record and for same plan and S3 I have 150 recs and for same plan and S4 I have 200 recs
fist thing I should count how many records are there for under S1+540 and so forth for all 4 combinations then again combine all 4 counts and again count total number of records. Then finally update the files.
I hope you got my requirement
Pls let me know if you can find a solution for this using Sort. for inital counts atleast. Then I will go for a cobol program for updating the records.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Please show sample input and output with relevent fields and indicate the position, length and format of the relevent fields. Also, what is the RECFM and LRECL of the input file.
OUTPUT FILE should contain the following
The fields are:
Plan code, sscode, number of recs per sscode in the plan, total number of recs(s1+s2+s3+s4 per plan)
900, S1, 2, 6
900, S2, 1, 6
900, S3, 1, 6
900, S4, 2, 6