MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 10:23 am Post subject: Pick all Policy Number records based on selection criteria
Hi,
Please help to get SORT JCL for the below problem.I have an input file with following record layout.
Code:
Account X(10)
Code X(02)
Policy Number X(20)
Transaction id X(02)
Filler X(10)
Tran Id X(02)
1. Check for code = "F4"
2. Check for Tran id = "RB" and if found copy all the records for that policy to the new splitted file sorted on policy number.
3. Output file 2 will have only those records which are not in Output file 1.
For eg.
Input file
Code:
1234567890F4POL1234554321 44 RB
9999999999F4POL5555555555 44 RB
2222222222F4POL2323232323 44 RB
2323567890F4POL6467382992 46 09
1212222230A4POL3434432332 42 05
1234567890F4POL1234554321 46 09
9999999999F4POL5555555555 46 09
2222222222F4POL2323232323 43 RR
Output file 1
Code:
1234567890F4POL1234554321 44 RB
1234567890F4POL1234554321 46 09
2222222222F4POL2323232323 44 RB
2222222222F4POL2323232323 43 RR
9999999999F4POL5555555555 44 RB
9999999999F4POL5555555555 46 09
Output file 2
Code:
1234567890F4POL1234554321 44 RB
1212222230A4POL3434432332 42 05
Let me know if you need more explanation.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jul 05, 2006 10:48 am Post subject:
Quote:
3. Output file 2 will have only those records which are not in Output file 1.
But your sample output shows something else. It should be
Code:
1212222230A4POL3434432332 42 05
2323567890F4POL6467382992 46 09
If that is true then the following DFSORT/ICETOOL JCL will give you the desired results. You need the April, 2006 DFSORT PTF installed for this job to work
Code:
//STEP0100 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD *
1234567890F4POL1234554321 44 RB
9999999999F4POL5555555555 44 RB
2222222222F4POL2323232323 44 RB
2323567890F4POL6467382992 46 09
1212222230A4POL3434432332 42 05
1234567890F4POL1234554321 46 09
9999999999F4POL5555555555 46 09
2222222222F4POL2323232323 43 RR
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT1) ON(13,20,CH) WITH(1,46) -
WITHALL KEEPBASE KEEPNODUPS USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(47:C' ')),
IFTHEN=(WHEN=(11,2,CH,EQ,C'F4',AND,45,2,CH,EQ,C'RB'),
OVERLAY=(47:C'RB'))
SORT FIELDS=(13,20,CH,A,47,2,CH,D)
OUTFIL FNAMES=OUT1,
INCLUDE=(11,2,CH,EQ,C'F4',AND,47,2,CH,EQ,C'RB'),
OUTREC=(1,46)
OUTFIL FNAMES=OUT2,SAVE,
OUTREC=(1,46)
/*
Hope this helps....
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 11:47 am Post subject:
Thanks Kolusu for quick reply.
Its not working on my shop. May be we don't have new release. I am getting syntax error for IFTHEN. Could it be possible with normal Dfsort utility ?
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jul 05, 2006 11:52 am Post subject:
Rahull , Quote:
Its not working on my shop. May be we don't have new release. I am getting syntax error for IFTHEN. Could it be possible with normal Dfsort utility ?
Post your complete DFSMSG's here
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 12:01 pm Post subject:
When I ran it first with the JCL you gave me I got the below error messages:
Code:
SYT000I SYNCTOOL RELEASE 1.4D - COPYRIGHT 2003 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
SPLICE FROM(IN) TO(OUT1) ON(13,20,CH) WITH(1,46) -
WITHALL KEEPBASE KEEPNODUPS USING(CTL1)
SYT050E INVALID OPERAND ON "SPLICE" STATEMENT
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12
II: When I run after removing KEEPBASE, KEEPNODUPS, I got the below error messages:
Code:
.SYT000I SYNCTOOL RELEASE 1.4D - COPYRIGHT 2003 SYNCSORT INC.
.SYT001I INITIAL PROCESSING MODE IS "STOP"
.SYT002I "TOOLIN" INTERFACE BEING USED
.
. SPLICE FROM(IN) TO(OUT1) ON(13,20,CH) WITH(1,46) -
. WITHALL USING(CTL1)
.SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
.SARPAGE 5
. SYNCSORT FOR Z/OS 1.1CRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYN
. z/OS 1.7.0
. PRODUCT LICENSED FOR CPU SERIAL NUMBER 32BDD, MODEL 2084 304 LICE
. CTL1CNTL :
. INREC IFTHEN=(WHEN=INIT,
. * (This asterik is below IFTHEN)
. OVERLAY=(47:C' ')),
. IFTHEN=(WHEN=(11,2,CH,EQ,C'F4',AND,45,2,CH,EQ,C'RB'),
. OVERLAY=(47:C'RB'))
. SORT FIELDS=(13,20,CH,A,47,2,CH,D)
. OUTFIL FNAMES=OUT1,
. INCLUDE=(11,2,CH,EQ,C'F4',AND,47,2,CH,EQ,C'RB'),
. OUTREC=(1,46)
. OUTFIL FNAMES=OUT2,SAVE,
. OUTREC=(1,46)
. WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
. WER268A INREC STATEMENT : SYNTAX ERROR
. WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
. WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 12:02 pm Post subject:
I am using SPLICE in many JCLs and its working fine. I don't know why its not working this time,.
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 12:50 pm Post subject:
Also, If I go with SAR message, system by default is picking up SYNCSORT. I check in system libary SYS1.SYNCLINK and I found the load of ICETOOL but ICETOOL is DFsort product?
Is there anything I m missing here ?
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jul 05, 2006 2:17 pm Post subject:
Rahull ,
Your shop's primary sort product is SYNCSORT and the version you have does not support IFTHEN and INREC on SPLICE parm.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Jul 05, 2006 2:25 pm Post subject:
Quote: system by default is picking up SYNCSORT. I check in system libary SYS1.SYNCLINK and I found the load of ICETOOL but ICETOOL is DFsort product?
Kolusu's job works fine with DFSORT's ICETOOL. But since you're using Syncsort, you're using Syncsort's SYNCTOOL, not DFSORT's ICETOOL. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 05, 2006 2:30 pm Post subject:
Thanks Frank for the update.
Should I write a cobol program for my problem? Or can we still achieve the same in multiple steps ?
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jul 06, 2006 8:29 am Post subject:
Rahull,
The following Synctool JCL will give you the desired results.
Code:
//STEP0100 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
1234567890F4POL1234554321 44 RB
9999999999F4POL5555555555 44 RB
2222222222F4POL2323232323 44 RB
2323567890F4POL6467382992 46 09
1212222230A4POL3434432332 42 05
1234567890F4POL1234554321 46 09
9999999999F4POL5555555555 46 09
2222222222F4POL2323232323 43 RR
//T1 DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//T2 DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=SHR
// DD DSN=*.T2,VOL=REF=*.T2,DISP=SHR
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) USING(CTL1)
SPLICE FROM(CON) TO(OUT1) ON(13,20,CH) WITH(1,46) WITHALL -
USING(CTL2)
//CTL1CNTL DD *
INREC FIELDS=(01,46,
11,02,
45,02)
SORT FIELDS=(13,20,CH,A)
OUTREC FIELDS=(1,46,
47,4,CHANGE=(1,C'F4RB',C'9'),
NOMATCH=(C'0'))
OUTFIL FNAMES=T1,
NODETAIL,REMOVECC,
SECTIONS=(13,20,
TRAILER3=(12X,13,20,46:X,
MAX=(47,1,ZD,EDIT=(T))))
OUTFIL FNAMES=T2
//CTL2CNTL DD *
OUTFIL FNAMES=OUT1,
INCLUDE=(47,1,CH,EQ,C'9'),
OUTREC=(1,46)
OUTFIL FNAMES=OUT2,SAVE,
OUTREC=(1,46)
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Wed Jul 19, 2006 1:37 pm Post subject: Sort on Policy
Hi,
Is it possible to split the file with same policy number record but are in pair in one file and all other records in second file. If there are more then 2 records for the same policy, it should not come to file 1. Only those policy records which comes in pair should be in file 2 and all other in file2.
1234567890F4POL1234554321 44 RB
1234567890F4POL1234554321 46 09
1234567890F4POL1234554321 47 05
1111111111F4POL1212121212 43 RR
1111111111F4POL1212121212 46 09
2222222222F4POL2323232333 43 RR
Output File 1
1111111111F4POL1212121212 43 RR
1111111111F4POL1212121212 46 09
Output file 2
1234567890F4POL1234554321 44 RB
1234567890F4POL1234554321 46 09
1234567890F4POL1234554321 47 05
2222222222F4POL2323232333 43 RR
Please help to get SORT JCL for this problem.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jul 19, 2006 1:49 pm Post subject:
Rahull ,
Try this. I assumed that your policy number starts from pos 13 for 13 bytes.
Code:
//STEP0100 EXEC PGM=SYNCTOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD *
1234567890F4POL1234554321 44 RB
1234567890F4POL1234554321 46 09
1234567890F4POL1234554321 47 05
1111111111F4POL1212121212 43 RR
1111111111F4POL1212121212 46 09
2222222222F4POL2323232333 43 RR
//PAIR DD SYSOUT=*
//DUPS DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(PAIR) ON(13,13,CH) EQUAL(2) DISCARD(DUPS)
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Rahull Beginner Joined: 29 Jan 2004 Posts: 62 Topics: 19
Posted: Thu Jul 20, 2006 8:43 am Post subject:
Hi, Could you tell what's wrong in below job step. I want to sort PAIR file again on policy and trasaction id:
Code:
//STEP0100 EXEC PGM=SYNCTOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD *
1234567890F4POL1234554321 44 RB
1234567890F4POL1234554321 46 09
1234567890F4POL1234554321 47 05
1111111111F4POL1212121212 43 RR
1111111111F4POL1212121212 46 09
2222222222F4POL2323232333 43 RR
//PAIR DD SYSOUT=*
//DUPS DD SYSOUT=*
//SRTPAIR DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(PAIR) ON(13,13,CH) EQUAL(2) DISCARD(DUPS)
SORT FROM(PAIR) USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(13,13,CH,A,26,2,CH,A)
OUTFIL FNAMES=SRTPAIR,OUTREC=(1,80)
/*
//*
I am getting error on SORT Fields.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jul 20, 2006 8:51 am Post subject:
Quote:
I am getting error on SORT Fields
Rahull ,
How am I Supposed to help you without error messages? If your intention is to resort the pair file once again , you need to allocate a Dataset to PAIR DD instead of writting to sysout.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum