|
View previous topic :: View next topic
|
| Author |
Message |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi,
I'm new to use ICETOOL. Please help me regrding the below query.
I have two data sets with the following attributes.
DS1 - RECFM=FB, LRECL=78, Pass_no(CHAR type)=8 bytes in length, starts in Column 1, May be DUPS in Pass_no.
DS2 - RECFM=FB, LRECL=15, Pass_no(CHAR type)=8 bytes in length, starts in Column 1, May be DUPS in Pass_no.
I need to get Pass_no alone from both data sets without DUPS.
Output - RECFM=FB, LRECL=8, Pass_no=8 bytes in length, starts in Column 1,
I tried below ICETOOL job.
| Code: |
//DS1 DD DSN=...
//DS2 DD DSN=...
//T DD DSN=&&T,DISP=(MOD,PASS)....
//OUTPUT DD DSN=...
//TOOLIN *
COPY FROM(DS1) TO (T) USING(CTL1)
COPY FROM(DS1) TO (T) USING(CTL1)
SELECT FROM(T) TO(OUTPUT) ON(1,8,CH) FIRST
/*
//CTL1CNTL DD
OPTION COPY
INREC BUILD=(1,8)
/* |
BTW, ICETOOL is in my installation with ICE201I F RECORD TYPE ...
I hope this will work as I expect. Please let me know if I am wrong. Also, is there any better way for the same?
Your help is appreciated! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| I hope this will work as I expect. Please let me know if I am wrong. |
Why not just try it and find out?
If you need more help, post an example of your input and expected output. |
|
| Back to top |
|
 |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi Frank,
I tried and got the output. Just checking if I'm doing correctly.
Example(as explained in my first post),
DS1:
| Code: |
A2389012......
A2398032......
A4454444......
A2389012......
A2398032...... |
DS2:
| Code: |
A2389012......
A2398032......
A6666666......
|
OUTPUT:
| Code: |
A2389012
A2398032
A4454444
A6666666 |
Thank you very much. Have a good day! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, that looks right based on what you've posted. One nit: you don't need
in CTL1CNTL. The COPY operator supplies it automatically. |
|
| Back to top |
|
 |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
OKay, Frank. Thanks for the help!  |
|
| Back to top |
|
 |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi all,
Release Management here is not allowing that job to PROD since DISP=MOD can't be used in the step above.
So, I splitted that step into 3 steps as below.
Step1:
| Code: |
//SORTIN DD DSN=DS1....
//SORTOUT DD DSN=OUT1
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,8)
/* |
Step2:
| Code: |
//SORTIN DD DSN=DS2....
//SORTOUT DD DSN=OUT2
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,8)
/* |
Step3:
| Code: |
//SORTIN DD DSN=OUT1....
// DD DSN=OUT2....
//SORTOUT DD DSN=FINAL...
//SYSIN DD *
SORT EQUALS,FORMAT=CH,FIELDS=(1,8,A)
SUM FIELDS=NONE
/* |
I tested the above and it seemed that my approach is correct. Please me know if I'm wrong with the above steps.
And, kindly tell me if there is any other better to do the same.( I mean, without DISP=MOD)
Thank you! |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Gnana Sekaran Nallathambi,
You really don't have to reformat both files to lrecl of 8 , you can just reformat the larger LRECL file (78) to 15 bytes and then concatenate them to sortin and then remove dups
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input 78 byte file,DISP=SHR
//SORTOUT DD DSN=&&TM15,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,8,7X)
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input 15 byte file,DISP=SHR
// DD DSN=&&TM15,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC BUILD=(1,8)
SORT FIELDS=(1,8,CH,A),EQUALS
SUM FIELDS=NONE
//* |
|
|
| Back to top |
|
 |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
| Thanks, Kolusu. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|