Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
Kiran,
Your requirement is not so clear. Still if I could have understood it correctly, here is a JCL. Also you haven't mentioned properly which fields you want in output, I'm displaying all of them. You can change last OUTREC statement as per your requirement.
Thanks for overwhelming response for my query..
I am being an amateur to this Platform and forum, I am trying to learn as much as I can.
Most importantly,the reason I put in this query was I had a High Priority issue on this, which needs to be solved within a short span of time.
We respect encouragment from people like you.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Kiran,
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
The above input file1 and file2 must be compared on KEY(i.e.,SSN) and the when both the SSNs match then corresponding values M1 and M2 needs to moved to output file.If file1 SSN is not present in file2 ,then only file1 record needs to be written to be output file.
The Output file should look something like below.
Data in Output file .
Indicator SSN NAME Dept M1 M2
6 0021 Bill 87 76 32
2 0076 Nick 09 87 16
5 0089 Leo 23
7 7898 Neo 08
1 9879 Phil 89 12 13
I will pleased to get a quick response on this.
Awaiting response.
Most importantly,the reason I put in this query was I had a High Priority issue on this, which needs to be solved within a short span of time.
Quote:
I will pleased to get a quick response on this.
Awaiting response.
Remember the urgency is a problem only on Your side
You should give us better reasons than just Your urgency,
for us to take time to please You with a quick reply
do You realize that the problem is exactly the same as before, only with the column offsets changed?
it would be nice if at least You would have tried
But maybe that' s just homework
a very smart politician once said
Quote:
To think evil is a sin, but most of the time You are right
Yes,I agree that urgency is from my end but still I have been trying to figure out this problem for last 3 days.
One of my colleagues suggested post a query on this forum,where I can get a glimpse of the solution.
Why don' t You try to help yourself a little bit,
rather than waiting for a diapering solution form the forum
it' s saturday and for most people is not a working day
hint...
look at the record layout from Your first question,
look at the record layout of the last question
meditate about the analogy of your last question with the first solution given to you
build the new ICETOOL parameters with the new fields positions/offsets
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
Hi Kiran,
Could you please use Code tag to show your Input and output, which will show exact position and length of the fields. And also you can give a try to modify the jcl given by me to suit your requirements. The forum members are always there to help you in that !
Thanks for your response.I have been trying the Jcl which you posted last night.Its working fine but I m facing problem in last SORT card SRT4CNTL.
I tried putting all efoort to get the output.
But I m not able to find the problem.
Can you please help me with the below requirement.
Input file1
Code:
Indicator SSN NAME Dept
2 0076 Nick 09
5 0089 Leo 23
6 0021 Bill 87
7 7898 Neo 08
1 9879 Phil 89
The above input file1 and file2 must be compared on KEY(i.e.,SSN) and the when both the SSNs match then corresponding values M1 and M2 needs to moved to output file.If file1 SSN is not present in file2 ,then only file1 record needs to be written to be output file.
The Output file should look something like below.
Data in Output file .
Code:
Indicator SSN NAME Dept M1 M2
6 0021 Bill 87 76 32
2 0076 Nick 09 87 16
5 0089 Leo 23
7 7898 Neo 08
1 9879 Phil 89 12 13
I m just getting the ouput in sorted order but not as per my requirement and a character "B" is appended in the 1st column of the record in the output file.
Can please tell me how sort card#3 SRT3CNTL works.
I tried finding it on the forum and manuals.But I am not able to find one such case.
Is comparison done on column names in different files?
If I want to compare fields in different files and which are at different positions.That is, field name RR-SSN(Positioned at 2) of file1 and field MM-SSN(Positioned at 5) of file2.How do we put this in the condition "IFTHEN=(WHEN=(condition))".And If there is no match,how condition can be?
Per above, are we copying IN1 and IN2 to same temp file (TEMP1).
ParagChouguley wrote:
Hi Kiran,
Could you please use Code tag to show your Input and output, which will show exact position and length of the fields. And also you can give a try to modify the jcl given by me to suit your requirements. The forum members are always there to help you in that !
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
Hi Kiran,
Its a good thing that you are using proper tags for code part and also you did some research ! Great !
Now, you say
Quote:
Per above, are we copying IN1 and IN2 to same temp file (TEMP1)
Yes, we are copying data from both the input files to a single temporary file and rearranging it so as SPLICE operator can compare it !
You also have many other questions, but it's tough for me to answer them.
Could you please use COLS command before you copy your input and expected output here. So that the forum members can get exact idea about the position and length of fields.
If (2,9) of file1 = (5,9) of file2 then I would like to append (93,12) of file2 to the end of first file record and that record needs to be written to output file.
If (2,9) of first file is not equal to (5,9) second file then I would like to write only the record of file1 to output file.
Can you please let me know how the above condition can be handled through IFTHEN condition.
Or do we have any other way for the above.
I am not able find any one such case in the forum or manual.
Awaiting reply.
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
Hi Kiran,
Again there is discrepancy between what you are saying now and what you said earlier.
Now you say (2,9) of file1, but as per your sample input file 1, SSN starts at 11th byte.
Also you say (5,9) of file2, but as per your sample input file 1, SSN starts at 11th byte.
Please provide correct information in order forum members to help you.
Sorry for the discrepany.Actually the inputs were just an example.
Later when I looked into my actual inputs, I found SSNs positions differ.
Now I m putting in actual scenario below.Please accept this and provide me JCL for this.
Details are below:
Input file1
Code:
I SSN NAME DEPT
2 0001 NICK 20
4 0005 LOE 30
3 0002 POLO 87
6 0004 PHIL 76
7 9898 JACK 87
Input file2
Code:
YEAR SSN NAME MTOT M1 M2 D1 D2
2008 0002 POLO 200 78 76 43 65
2008 0004 PHIL 345 98 80 13 45
2008 9898 JACK 987 78 89 23 24
If (3,4) of file1 = (6,4) of file2 then I would like to append (20,11) of file2 to end of record file1
If (3,4) of file1 is not equal to (6,4) of file2 then I would like to write
only the record of file1 to output file
I want the records to be sorted on SSNs
The output file should look like below
Code:
I SSN NAME DEPT M1 M2 D1 D2
2 0001 NICK 20
3 0002 POLO 87 78 76 43 65
6 0004 PHIL 76 98 80 13 45
4 0005 LOE 30
7 9898 JACK 87 78 89 23 24
I feel sorry for the discrepancies before.
And please let me know if you need any other information.
ParagChouguley wrote:
Hi Kiran,
Again there is discrepancy between what you are saying now and what you said earlier.
Now you say (2,9) of file1, but as per your sample input file 1, SSN starts at 11th byte.
Also you say (5,9) of file2, but as per your sample input file 1, SSN starts at 11th byte.
Please provide correct information in order forum members to help you.