The above file refers column2 and column3 values are in the filename mentioned in column1.
I want the below to be perfomed with the above file(this file will be changing in each run)
1)Need to get the filename(column1) into a output file with the duplicates removed
2)All these files from step1 should be merged to a single file(input to the merge is dynamic).
3)Count of each file and the merged file into another file with filename and count
Example
count
AAAA.FILE1 - 100
AAAA.FILE2 - 100
AAAA.FILE3 - 100
AAAA.FILE4 - 100
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
shantid wrote:
The above file refers column2 and column3 values are in the filename mentioned in column1.
I want the below to be perfomed with the above file(this file will be changing in each run)
1)Need to get the filename(column1) into a output file with the duplicates removed
2)All these files from step1 should be merged to a single file(input to the merge is dynamic).
3)Count of each file and the merged file into another file with filename and count
shantid,
Are all files to be merged have same DCB properties (LRECL, RECFM ...)?
Do you have the authority to submit a job dynamically via INTRDR?
Is there anything in these files that identifies them uniquely ?
giraffe,
You need to spend some time reading the Op's question again before you answer.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
devil13 wrote:
Hi Arun,
Well it worked fine for me and I got the ouput. The result from my spool:
Delete the MEM1 from your PDS first and then re-run your job. The INCLUDE MEMBER=MEM1 is substituted well before running the first step which creates it. You would get a JCL error when you try to run the job.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
devil13 wrote:
Well it worked fine for me
devil13,
You cannot edit the job which has already started running. One possible way is to submit it through INTRDR which Kolusu has already mentioned here, but the OP is restricted to do.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Shanthid wrote:
Skolusu,
Yes merged files have the same DCB properties
What is the LRECL and RECFM for the files.
Shanthid wrote:
No,we dont have access for INTRDR.
Well I can show you a way to create JCL needed to merge all the dataset and get the counts but if you don't have INTRDR access then you need to manually submit the job.
Shanthid,
What is the purpose of the data in Column 2 and Column 3 in your original post? Are those some kind of criteria for including records (in the Step2 merge) from the file(s) identified in Column 1? Or can they just be ignored?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
devil13 wrote:
Hi All,
It was an easy thing to figure out. I have mentioned the MEM1 as DISP=OLD.
Well I missed to mention about adding dummy data. But I thought it would be easy to figure that out
This JCL definitely works
Devil13,
Apart from adding a dummy member before running the job. There are a few things you missed.
1. The Max length of a file name is 44 bytes. Your first problem is building the dynamic file names in the COUNT control cards
2. You are merging the datasets based on the first char in the files. what makes you think the data is already sorted on the first byte?
3. Since you did not account for varying length file names your job would abend as the DISP is coded after DSN name.
Running your test job is fine with creating a member in your pds, but what if the same job needs to used in production? Imagine how many jobs would be held up since you had DISP=OLD on a Production PDS.
You need to consider all scenarios before you post a solution and claim it to be working.
And just for the record , you don't need 2 steps (one to merge and 1 to get the count as we can get all of them in one go).
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Skolusu wrote:
The INCLUDE MEMBER=MEM1 is substituted well before running the first step which creates it
devil13,
I wonder still you did not/are not willing to understand this. It's better not to make any further posts until we hear from the OP on the requested info.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
Quote:
There is always a better solution.
In linear programming (a branch of methematics), an optimal solution means there is no better solution, period. Computer programming deals with a number of linear programming issues -- such as the traveling salesman problem -- so if an optimal solution exists to the linear programming problem, your tag line is not a true statement.