I have one file with RECFM=VB & Record Length is 1504 with different types of data with Header record as record type '1' Detail '2' & trailer '3' @ position 37.
There is an X ID from 23rd column for 9 bytes which has all these 3 types of record i.e. 1 or 2 or 3 type.
All the record starts with a Y ID for first 5 bytes which would be same for a same set of X ID records.
Now I need to make the 2 output files.
1. will contain only those records whose first 5 bytes or Y ID is a value say '77777' and also the 751 th column upto 3 Bytes of Detail record i.e record type '2' is having numeric value as 888 Or 999 or 000. While writing this file the group of records should be on the basis of X ID.
2. The rest of the file..
Code:
I/p example..
----+----1----+----2----+----3----+----4----+----5----+
********************************* Top of Data *********
77777056072124201110195600218960000112011100320111003A1 .. Header rec
7777705607212420111019560021896000022 395608N492810860 .. Detail Rec .. @751 value is 999 as numeric
7777705607212420111019560021896000033000010000002862B00 .. Trailer Rec
88888056072124201110197001720290000112011100520111005A1
8888805607212420111019700172029000022 599746N597623721 .. Detail rec @751 value is 001
8888805607212420111019700172029000032 800351N001210775 .. Detail rec @751 value is 001 these wud be same
8888805607212420111019700172029000073000050000000976F00
88888056072124201110197001721100000112011100520111005A1
8888805607212420111019700172110000022 953911N540920191 .. Detail rec @751 value is 000
8888805607212420111019700172110000032 762815N003952775 .. Detail rec @751 value is 000
8888805607212420111019700172110000042 614406N000245800 .. Detail rec @751 value is 000
8888805607212420111019700172110000052 065255N495020500 .. Detail rec @751 value is 000
8888805607212420111019700172110000075000050000017994D00
E.g: here Y Id s are 77777 & 88888 with X ID s starting from 23rd column of 9 bytes i.e. 560021896 or 700172029 or 700172110 that have data type '1' '2' or '3'.
And in the Data type '2' there could be multiple entries but 751 th column wud be same for a specific X ID; wud be either '000' or '888' & '999' etc.
Note: The first file would be written only when Y ID = '77777' & 751 th column is among '000' / '888' / '999'.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
1. will contain only those records whose first 5 bytes or Y ID is a
value say '77777' and also the 751 th column upto 3 Bytes of Detail
record i.e record type '2' is having numeric value as 888 Or 999 or 000.
I'm not clear on all of the variations you want to handle. Perhaps a more extensive example of input and output would help.
Specifically:
Will you only be selecting on a single value of the X ID (e.g. 77777) or could you select on multiple values of the X ID (e.g. 77777 and 99999 and 00000)?
Can you select more than one X ID/Y ID group? For example, could you have
77777 group with YID1 and 999
77777 group with YID2 and 666
77777 group with YID3 and 888
77777 group with YID4 and 000
Would you want the groups for 77777 YID1, YID2 and YID4 in output1?
Actually I need only for a single value of YID and that is '77777' under which group would be on the basis of a single X ID with its detail value as 999/000/888.
each XID will be either with 999 or 000 or 888 but the Detail line i.e. '2' occurrence could be multiple
such that...
YID1 with XID1 Header i.e. record type '1'
YID1 with XID1 Detail i.e. record type '2' with 000
YID1 with XID1 Detail i.e. record type '2' with 000
YID1 with XID1 Detail i.e. record type '2' with 000
YID1 with XID1 Trailer i.e. record type '3'
But the Output file would be
first file:
77777 group with XID1 with value 000/999/888
77777 group with XID2 with value 000/999/888
77777 group with XID6 with value 000/999/888
second file could be :
77777 group with XID3 with value other than 000/999/888
88888 group with XID4 with value other than 000/999/888
99999 group with XID5 with value other than 000/999/888
77777 group with XID7 with value like 111/222 i.e. anything other than 000/999/888
please let me know if its still not comprehending..
Because your positions match sample input data shown and because your input is VB, I have added 4 bytes for RDW. If that's not the case you need to re-adjust positions. If your input file already sorted on key fields then add SORTED,NOSEQCK in your joinkey to save extra processing.
Frank,
I might have completely misunderstood OP's requirement. Below is just an attempt for the alternate solution.
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
Hi,
also you need ICE201I message to be at least ICE201I G or higher for JOINKEYS to function, it appears from the errors you are getting you do not have the correct Level of DFSORT.
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
Quote:
Using JOINKEYS with ICETOOL SORT and COPY
You can use a JOINKEYS application with a COPY or SORT operator of ICETOOL, but not with any of the other
ICETOOL operators. A new JKFROM operand can be used instead of a FROM(indd) operand for the SORT and
COPY operators to tell DFSORT you will provide a JOINKEYS statement with F1=ddname1 for the F1 file and a
JOINKEYS statement with F2=ddname2 for the F2 file, as well as JOIN and REFORMAT statements as needed.
With JKFROM, ICETOOL will use 'JOINKEYS' in the ICE606I message instead of the FROM ddname and will
terminate if a JOINKEYS application is not specified correctly.
For multiple JOINKEYS applications within a single ICETOOL step:
You can reference different JOINKEYS F1 and F2 input files for the different SORT and/or COPY operators
by using F1=ddname and F2=ddname on the various JOINKEYS statements as appropriate
User Guide
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 20:03 ON SUN OCT
This message indicates you are using z/OS DFSORT V1R5, an unsupported release of DFSORT on an unsupported release of z/OS. And you're using a downlevel version of that DFSORT release which doesn't support JOINKEYS.
The supported versions are z/OS DFSORT V1R10 for z/OS 1.10-1.11 and z/OS DFSORT V1R12 for z/OS 1.12-1.13. You really need to move to a supported version of DFSORT before I can help you.
Ask your System Programmer why your site is running on an unsupported z/OS release and when you will be moving to a supported release.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I also want to update my knowledge in ICETOOL a bit.. can you please suggest any tutorial for basics.
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:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Hey, that's not as bad as I thought. Only one z/OS release away from being supported.
Hopefully you'll get to a supported release of z/OS one of these days (that would be z/OS 1.10 and above as of this writing) and get the updated DFSORT release that goes with it.