Your requirement is not clear..... What is that you want..u want to insert the value of rec 1 and 2 for the first 3 records or u want to fill the values where u find "rec" and not "record".
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Gnath,
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=55, but the job can be changed appropriately for other attributes.
Thx for Your Reply on this. Can you please explain how the 'BUILD=(C'MyMonth,''',11,7,C'''')), ' statement is work in the above job. i didn't heard this statement. and can you please tell me, why you take the string 'MyMonth' and 'MyCode' and what is it significant.
Please, Briefly explain the above job how it will work.
First it will copy the first two records and it will stop after 2 records and then it will check according to IF statement. but here i didn't understand the statement "INREC IFOUTLEN=80,'. and then it will create two variables like 'My Month' and 'My Code'. so we get the values from input file in to this variables using BUILD statement.
and next step, we copy the input file by skiping the first two records including with 'My Month' and My Code' and remaining 1 to 55 bytes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
is my understanding is rt?
Yes.
Quote:
i didn't understand the statement "INREC IFOUTLEN=80,'
IFOUTLEN=80 just ensures that the resulting record length is 80 which is required for the SYMNAMES data set.
Quote:
but i got the error like
The job I posted works as shown. You must have changed something. I can't tell what you changed from what you posted (other than that you changed Mymonth to MYMONTH). Please post all of your JCL so I can see what you did.
Remember that all the temporary datasets should have DISP as MOD, as they are appended.
Moreover, this soln would work only for fixed number of records for a perticular month. currently it is 3. If they become 5, you have to replace 3 by 5 in your code. But this number should be preknown and constant.
Moreover, positions of fields in month and code record are important here.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Rguhanath,
Good grief. You've totally changed the requirement! In your original requirement you had ONE group of records with the Month, Code, Detail and Total records, so I gave you a simple solution involving symbols. I created the Symbols in my first step and used them in my second step.
Now you've totally changed the requirement to have MULTIPLE groups of records. That requires a completely different solution!
In your attempt at a solution, you threw away my first step and only used my second step. Since the first step that you threw away creates the symbols, and the second step that you kept uses the symbols, using just the second step obviously won't work since there are NO symbols. That's why you got the syntax error on the MNTH symbol - you never created it.
As for a solution for your new requirement, I need to know the approximate maximum number of groups of records you will have (where a group starts with MONTH and ends with TOTAL). Is it 20, 200, 2000 or what?
I am Sorry. Actually i think this is small thing to do in jcl. but after implementaton with your code, i come to know its not work to my actuall requirement. so thats why i am again post my new requirement.
as per your query, the maximum number of groups of records will be vary depending on the input file. and the group of records also varying(after CODE to befor TOTAL records). so the constant records are only the MONTH and CODE records. below i am given my requirement.