View previous topic :: View next topic
Author
Message
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Hi Masters,
I have 2 input files with record lengths of 68 and 366 respectively. I want to get all the details with mathcing number key located in the first position with 13 bytes length and unmatching number key.
The match output file must be formatted to 26 record length and will only contain number key (pos 1, length 13-- in file 1), number (pos 14, length 10 -- in file 1) and quantity (pos 60, length 3 -- in file 2)
Input file1
111111111111106/15/20092222222222
333333333333306/15/20092222222222
444444444444406/15/20092222222222
555555555555506/15/20092222222222
Input File2:
111111111111106/15/20092222222222 444
222222222222206/15/20092222222222 555
333333333333306/15/20092222222222 111
444444444444406/15/20092222222222 222
JCL:
//STEP1 EXEC PGM=SORT
//SORTJNF1 DD DSN=WXX220.INPUT.FILE1,DISP=SHR
//SORTJNF2 DD DSN=WXX220.INPUT.FILE2,DISP=SHR
//****
//SORTOF01 DD DSN=WXX220.UNMATCH.FILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=26),
// DATACLAS=STANDARD
//SORTOF02 DD DSN=WXX220.MATCHED.FILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=26),
// DATACLAS=STANDARD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE)
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE)
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
REFORMAT FIELDS=(F1:1,68,F2:1,366),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(69,1,BI,EQ,X'FF'),
OUTREC=(1,13,14,10)
OUTFIL FILES=01,INCLUDE=(1,1,BI,EQ,X'FF'),
OUTREC=(69,13,82,14)
OUTFIL FILES=02,INCLUDE=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF')
OUTREC=(1,13,14,10,24,10,129,3)
/*
Error:
SYNCSORT FOR Z/OS 1.2.3.0R U.S. PATENTS: 4210961, 5117495 (C) 20
[COMPANY NAME] z/OS
PRODUCT LICENSED FOR CPU SERIAL NUMBER xxxxx, MODEL 2097 605
SYSIN :
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
REFORMAT FIELDS=(F1:1,68,F2:1,366),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(69,1,BI,EQ,X'FF'),
OUTREC=(1,13,14,10)
OUTFIL FILES=01,INCLUDE=(1,1,BI,EQ,X'FF'),
OUTREC=(69,13,82,14)
OUTFIL FILES=02,INCLUDE=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF')
OUTREC=(1,13,14,10,24,10,129,3)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Can anyone help me how come syntax error in OUTREC?
Thanks
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8796 Location: Welsh Wales
try changing
Code:
OUTFIL FILES=02,INCLUDE=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF')
OUTREC=(1,13,14,10,24,10,129,3)
to
Code:
OUTFIL FILES=02,INCLUDE=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF'),
OUTREC=(1,13,14,10,24,10,129,3)
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
eytellene ,
As expat pointed out, you are missing a comma after your INCLUDE statement. If you are still encountering a problem after adding the comma, please let us know.
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Hi expat and Alice,
Thanks... but a different error occured
STEP1 , -SORTOF01 DUPLICATE OUTFIL SPECIFICATION
Isn't it possible to declare 2 OUTFILS? Since I want all the unmatched details from both file 1 and file 2 to be outputed in the unmatched output file?
Back to top
mfsundar New User Joined: 05 Apr 2009Posts: 7 Location: India
Try the below code
Code:
SORT EXEC PGM=SORT
SYSUDUMP DD SYSOUT=D
SYSSRT DD SYSOUT=J
SYSOUT DD SYSOUT=J
SORTWK01 DD SPACE=(CYL,(80),RLSE),UNIT=SYSDA
SORTWK02 DD SPACE=(CYL,(80),RLSE),UNIT=SYSDA
SORTWK03 DD SPACE=(CYL,(80),RLSE),UNIT=SYSDA
SORTJNF1 DD DSN=XXXXXX.INPUT.FILE1,DISP=SHR
SORTJNF2 DD DSN=XXXXXX.INPUT.FILE2,DISP=SHR
SORTOF01 DD DSN=XXXXXX.UNMATCH.FILE,
DISP=(NEW,CATLG,DELETE),
UNIT=SYSDA,
SPACE=(0,(1,10),RLSE),
DCB=(RECFM=FB,LRECL=27,BLKSIZE=0)
SORTOF02 DD DSN=XXXXXX.MATCHED.FILE,
DISP=(NEW,CATLG,DELETE),
UNIT=SYSDA,
SPACE=(0,(1,10),RLSE),
DCB=(RECFM=FB,LRECL=36,BLKSIZE=0)
SORTOUT DD SYSOUT=J
SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,68,F2:1,366),FILL=X'FF'
SORT FIELDS=COPY
OUTFIL FILES=01,
IFTHEN=(WHEN=(1,1,BI,EQ,X'FF'),
BUILD=(1:69,13,14:82,14)),
IFTHEN=(WHEN=(69,1,BI,EQ,X'FF'),
BUILD=(1:1,13,14:14,10)),
IFTHEN=(WHEN=NONE,BUILD=(1:27X)),
OMIT=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF')
OUTFIL FILES=02,
IFTHEN=(WHEN=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF'),
BUILD=(1:1,13,14:14,10,24:24,10,34:129,3)),
IFTHEN=(WHEN=NONE,BUILD=(1:36X)),
OMIT=(1,1,BI,EQ,X'FF',OR,69,1,BI,EQ,X'FF')
/*
It works fine for me. Test with your sample data and let me know.
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Hi mfsundar,
I have copied your sysin yet syntax error occured
error:
SYNCSORT FOR Z/OS 1.2.3.0R U.S. PATENTS: 4210961, 5117495 (C)
[COMPANY NAME] z
PRODUCT LICENSED FOR CPU SERIAL NUMBER xxxxx, MODEL 2097 603
SYSIN :
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,68,F2:1,366),FILL=X'FF'
SORT FIELDS=COPY
OUTFIL FILES=01,
IFTHEN=(WHEN=1,1,BI,EQ,X'FF'),
*
BUILD=(1:69,13,14:82,14)),
IFTHEN=(WHEN=69,1,BI,EQ,X'FF'),
*
BUILD=(1:1,13,14:14,10)),
IFTHEN=(WHEN=NONE,BUILD=1:26X)),
OMIT=(1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF')
OUTFIL FILES=02,
IFTHEN=(WHEN=1,1,BI,NE,X'FF',AND,69,1,BI,NE,X'FF'),
*
BUILD=(1:1,13,14:14,10,24:24,10,34:129,3)),
IFTHEN=(WHEN=NONE,BUILD=1:26X)),
OMIT=(1,1,BI,EQ,X'FF',OR,69,1,BI,EQ,X'FF')
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER270A OUTFIL STATEMENT : DUPLICATE PARM FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Did I miss out something?
Back to top
mfsundar New User Joined: 05 Apr 2009Posts: 7 Location: India
Yes, you missed the braces after "WHEN=" in three statements. To avoid confusion please copy and paste from my code and then execute the job.
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
hi mfsundar,
Thanks
The JCL worked fine yet the unmatch output file 1 has records in the 24th to 27th position
222222222222206/15/20092222
555555555555506/15/2009
I just wanted its output file to be
222222222222206/15/2009
555555555555506/15/2009
I have changed its length to 23, yet its having ann error of incompatible length.
error:
JOINKEYS REFORMAT RECORD LENGTH= 434, TYPE = F
SORTOF01 : RECFM=FB ; LRECL= 23; BLKSIZE= 27991
SORTOF02 : RECFM=FB ; LRECL= 36; BLKSIZE= 27972
SORTOF01 HAS INCOMPATIBLE LRECL
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
JNF1 STATISTICS
2,564K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
0 BYTES RESERVE REQUESTED, 1,016K BYTES USED
SORTJNF1 : RECFM=FB ; LRECL= 68; BLKSIZE= 27948
JNF2 STATISTICS
2,564K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
0 BYTES RESERVE REQUESTED, 1,016K BYTES USED
SORTJNF2 : RECFM=FB ; LRECL= 366; BLKSIZE= 27816
Thanks in advance
Back to top
mfsundar New User Joined: 05 Apr 2009Posts: 7 Location: India
It is ok for record length changed to 23. Also you should change "BUILD" statement of first "IFTHEN" for "FILES=01" like below code
change from
Code:
OUTFIL FILES=01,
IFTHEN=(WHEN=(1,1,BI,EQ,X'FF'),
BUILD=(1:69,13,14:82,14)),
to
Code:
OUTFIL FILES=01,
IFTHEN=(WHEN=(1,1,BI,EQ,X'FF'),
BUILD=(1:69,13,14:82,10)),
This code change is satisfy your requirement.
Previously i coded "BUILD=(1:69,13,14:82,14)", because you mentioned in the jcl as
Quote:
OUTFIL FILES=01,INCLUDE=(1,1,BI,EQ,X'FF'),
OUTREC=(69,13,82,14)
sorry for the confusion.
Back to top
mfsundar New User Joined: 05 Apr 2009Posts: 7 Location: India
Sorry i missed another one. You should also change along with my previous post in the "BUILD" statement of last "IFTHEN" for "FILES=01" like below code
from
Code:
IFTHEN=(WHEN=NONE,BUILD=(1:27X)),
to
Code:
IFTHEN=(WHEN=NONE,BUILD=(1:23X)),
Please let me know it's work fine or not.
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Okay thanks a lot
Back to top
mfsundar New User Joined: 05 Apr 2009Posts: 7 Location: India
You are welcome...
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
eytellene ,
If I got your requirement right, you dont really need this many IFTHENs. Here's a simplified SyncSort job to achieve this.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN= Input-1 (FB/68)
//SORTJNF2 DD DSN= Input-2 (FB/366)
//MATCH DD DSN= Output-1 (FB/26)
//NOMATCH DD DSN= Output-2 (FB/23)
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,13,A)
JOINKEYS FILE=F2,FIELDS=(1,13,A)
SORT FIELDS=COPY
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,23,F2:1,23,F2:60,3),FILL=X'FF'
OUTFIL FNAMES=NOMATCH,INCLUDE=(1,1,CH,EQ,X'FF',OR,24,1,CH,EQ,X'FF'),
IFTHEN=(WHEN=(1,1,CH,EQ,X'FF'),BUILD=(24,23)),
IFTHEN=(WHEN=NONE,BUILD=(1,23))
OUTFIL FNAMES=MATCH,SAVE,BUILD=(1,23,47,3)
MATCH
Code:
111111111111106/15/2009444
333333333333306/15/2009111
444444444444406/15/2009222
NOMATCH
Code:
222222222222206/15/2009
555555555555506/15/2009
Back to top
eytellene New User Joined: 19 May 2009Posts: 16 Location: Philippines
Hi arcvns,
I have tried the JCL, but I am encountering a syntax error. Did I miss out anything?
Error:
SYSIN :
JOINKEYS FILES=F1,FIELDS=(01,12,A,13,10,A)
JOINKEYS FILES=F2,FIELDS=(01,12,A,13,10,A)
SORT FIELDS=COPY
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,23,F2:1,23,F2:60,3),FILL=X'FF'
OUTFIL FNAMES=NOMATCH,INCLUDE=
*
(1,1,CH,EQ,X'FF',OR,24,1,CH,EQ,X'FF'),
*
IFTHEN=(WHEN=(1,1,CH,EQ,X'FF'),BUILD=(24,23)),
*
IFTHEN=(WHEN=NONE,BUILD=(1,23))
*
OUTFIL FNAMES=MATCH,SAVE,BUILD=(1,23,47,3)
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Your job have the INCLUDE statement like this. Put it in a single line as in my job or else move the 'INCLUDE=' also to the next line.
Quote:
OUTFIL FNAMES=NOMATCH,INCLUDE=
*
(1,1,CH,EQ,X'FF',OR,24,1,CH,EQ,X'FF'),
Back to top
r2k1984 New User Joined: 21 Jun 2005Posts: 69 Location: chennai
YOU CAN TRY WITH SPLICE WITH ICETOOL ..
IT WILL WORK ..
THANKS
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
r2k1984 wrote:
IT WILL WORK ..
r2k1984,
If you're replying to some topic and if you are really interested in helping somebody, please try to be specific to the problem rather than throwing in something.
And turn your CAPS off in future.
Back to top
Please enable JavaScript!