Object x(15) ex: "part "
ID x(6)
A 9(3)
B 9(3)
C 9(3)
Part-No 9(6)
FILLER x(20)
record description of 2nd type:
Object x(15) ex: "part name "
Part-No 9(6)
Part-Name x(20)
My required output should be as below:
Object x(15) ex: "part "
ID x(6)
A 9(3)
B 9(3)
C 9(3)
Part-No 9(6)
Part-Name x(20)
FILLER x(20)
The file can contain other types of record also..
Object field will decide the value in it. in my output the other types of records should be eliminated and only the "Part" objects must be present.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's not clear what you want to do. What field or fields are you matching on?
Please show an example of your input records with actual values and what you expect for the output records. Explain the "rules" for getting from input to output based on the example. Give the RECFM and LRECL of the input file.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Part records can have duplicates, in that case part name will be the same for the duplicate part records.
Sigh. Does that mean you want only one record with the same Part-No for output or all of the records with the same Part-No? Was it too much trouble to include this case in your example as I requested?
For example, if your input file had:
Code:
PART 100 230 410 111111
PART 100 230 410 111111
Part Name 111111 Bolt
would you want one record or two records for output?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Now I'm even more confused. You said you had two types of records in the input file, PART records and Part name records. I showed those two types in my input file example:
Code:
PART 100 230 410 111111
PART 100 230 410 111111
Part Name 111111 Bolt
and asked if the output would have one record (only one PART record) or two records (both PART records). Your answer was No (?). Then you showed an input file example with ONLY PART records with a different Part-no then I showed and kept all of the duplicate records for the output with the Part-Name from the input record you didn't show.
At this point, I can only guess at what you want. I'm guessing that you might have an input file like this:
Code:
PART 100 012 011 123456
PART 100 230 410 111111
PART 100 230 410 111111
PART 099 210 102 222222
AAA 123 123 ABCDE
AAA 099 123 BDECF
BBB 029 AB DEF 123
PART 100 114 011 123456
PART 001 002 005 123456
PART 999 888 777 123456
Part Name 123456 Screw
Part Name 111111 Bolt
Part Name 222222 Mirror
and you would want the output file to be this:
Code:
PART 100 230 410 111111 Bolt
PART 100 230 410 111111 Bolt
PART 100 012 011 123456 Screw
PART 100 114 011 123456 Screw
PART 001 002 005 123456 Screw
PART 999 888 777 123456 Screw
PART 099 210 102 222222 Mirror
If so, then you can use a DFSORT/ICETOOL job like the following:
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. "
I am confused with the lengths in my example given. Below is the actual requirement.
Please provide JCL for this requirement. The input records are as below.
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+
-------- PART 01232K01121{03051AZZZZ-------------
-------- PART 01232B01421A09011AXXXX-------------
-------- PART 01122{08015{01021AMMMM-------------
++++++++ NAME ZZZZHARI 4
++++++++ NAME XXXXRAMU 2
The LRECL is 800 and RECFM is VB.
And the output should be like this..
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+---
-------- PART 01232K01121{03051AZZZZ-------------HARI
-------- PART 01232B01421A09011AXXXX-------------RAMU
-------- PART 01122{08015{01021AMMMM-------------
The record types can be either 'PART' or 'NAME'
So, the matching should be done between the records for the part number.
Part number for PART records starts at position 44 and at position 19 for the NAME records.
The part number length is 4.
Whenever there is a matching found for the Part number exists in PART records and NAME records, then the name of the part should appear at the end of the PART records. And if the no match found, the part name will be space.
PART records length is 60 and NAME records length is 40(not LRECLs).
My output should only contain the PART records.
And at the end, the result file should be sorted on the field starting from position 26 to 31(the picture clause for it is: S9(4)V9(2).
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Have you even tried to work this out for yourself based on the previous example?
You've changed the requirement 3 times already. How many more changes will there be? Come back tomorrow morning and assure me there will be no more changes in the requirement and I'll give you one final solution.
I have used DFSORT SPLICE for one of my requirements.
I am getting the results as below.
If there is no base record for a particular key, I am getting only one overlay record spliced(others are eliminated from the output).
If there are more than one base records for a particular key, I am getting only one overlay record spliced and also one base record.
I need the results as below:
If there is no base record for a particular key, I should get all the overlay records in the output and spaces for the positions where the base record should have values in the output.
If there are more than one base records for a given key, I should get all the overlay records in the output. And for the Base record positions in the output file, i should get the values from the first base record(since there are more than one base records for a given key). And I should not get any base record
Please let me know with which options I can handle this.
Note: I am just using the KEEPNODUPS option with my SPLICE operand(except WITHALL and WITH)
----+----1----+----2----+----3----+----4----+----5----+----6----+
-------- PART 01232K01121{03051AZZZZ-------------
-------- PART 01232B01421A09011AXXXX-------------
-------- PART 01122{08015{01021AMMMM-------------
-------- PART 01122{08015{01021AMMMM-------------
++++++++ NAME ZZZZHARI 4
++++++++ NAME XXXXRAMU 2
The output I am getting is like below..
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+---
-------- PART 01232K01121{03051AZZZZ-------------HARI
-------- PART 01232B01421A09011AXXXX-------------RAMU
-------- PART 01122{08015{01021AMMMM-------------
The part number MMMM is appearing twice in the input file.. For this part there is no 'NAME' record.
So, I am getting only one record in the output for the part MMMM.
I am using the 'NAME' record as the base and 'PART as the overlay records.
Please let me know how what changes can be done in SPLICE to get all the records of PART(overlay) if there is no part 'NAME'(base record) reocrd exists for a given key.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you go back to the example I showed, you'll see I have the KEEPBASE operand for the SPLICE operator. It's missing from your SPLICE operator.
You need KEEPBASE to keep the first duplicate without a match.
If adding KEEPBASE doesn't give you what you want, then show me your complete ICETOOL job.