|
|
| Author |
Message |
sen_1983us
New User
Joined: 21 May 2005 Posts: 12 Location: Hyderabad
|
|
|
|
Is there any SYSIN command to sort-compare the following scenario
GDG(-1) - record length - 7 bytes
A1OCT18
A2OCT18
A3OCT17
A4OCT17
GDG(0) - record length - 7 bytes
A1OCT19
A2OCT18
A3OCT19
A4OCT17
A5OCT19
I should get the following output :
A1OCT19
A3OCT19
A5OCT19
GDG(0) and GDG(-1) should get compared:
1. if both has the same record , it shouldn't come in the output ,ex: A2OCT18 & A4OCT17 (A duplicate record would mean all the fields within the records have a one to one match. )
2. if new record[it shldn't be in GDG(-1)] was found in GDG(0) , it shld come in output , ex:A5OCT19
3. when comparing , if any of the record got changed from the previous version , it shld come in output, ex:A1OCT19 & A3OCT19.
I want this to be done in JCL , not in the program.
If any one of u know how to do this , pls send me the command. |
|
| Back to top |
|
 |
References
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4618 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... GDG(-1)
// DD DSN=... GDG(0)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(CON) TO(T1) ON(1,7,CH) NODUPS
SELECT FROM(T1) TO(OUT) ON(1,2,CH) LAST
/*
|
|
|
| Back to top |
|
 |
sen_1983us
New User
Joined: 21 May 2005 Posts: 12 Location: Hyderabad
|
|
|
|
HI Frank,
i'm describing my understanding if any wrong please correct me...
CON DD DSN=... GDG(-1)
DD DSN=... GDG(0)
in the above statements ur defining the GDG's
T1 DD DSN=&&T1 this is temporary file used to compare and check dups..
TOOLIN DD *
SELECT FROM(CON) TO(T1) ON(1,7,CH) NODUPS
SELECT FROM(T1) TO(OUT) ON(1,2,CH) LAST
here u r comparing in first step and making output in second step..
Regards
senthil |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4618 Location: San Jose, CA
|
|
|
|
Yes, CON concatenates the -1 input GDG and the 0 input GDG in that order.
Yes, T1 is a temporary file.
The first SELECT only keeps the nondup records between the two files based on the key in positions 1-7. The result is placed in T1.
The second SELECT uses the remaining records as input (T1) and selects the last record with each key in position 1-2 for output (OUT).
For complete details on DFSORT's ICETOOL, see Chapter 6 of "z/OS DFSORT Application Programming Guide". You can access all of the DFSORT books online, including that one, from:
www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html |
|
| Back to top |
|
 |
|
|
|