View previous topic :: View next topic
|
Author |
Message |
vinodkumar_pallampati
New User
Joined: 29 Jun 2010 Posts: 20 Location: chennai
|
|
|
|
Hi,
my input file contains numbers in the range from 9000000000 to
9999999999 in the middle some numbers are missed.
can someone tell me how to identify the missing numbers using jcl. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Yes. It is easy using DFSORT. Can you please confirm if your shop has DFSORT installed? What release?
By the way I had similar requirement couple of years back.. Here it is..
ibmmainframes.com/viewtopic.php?t=35891&highlight=
But now better solution is possible using joinkeys.. but you need to tell if it works at your shop .. for that we need what PTF installed at your shop |
|
Back to top |
|
|
vinodkumar_pallampati
New User
Joined: 29 Jun 2010 Posts: 20 Location: chennai
|
|
|
|
yes DF Sort installed. can you please tell me how to do it. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
vinodkumar_pallampati wrote: |
yes DF Sort installed. can you please tell me how to do it. |
Link I gave above has already one working solution.
As I said there is better one possible using joinkeys, please provide at what PTF you are..
Refer below post to know it..
ibmmainframes.com/viewtopic.php?t=33389 |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
Let us know the position in which these Key fields are present?
Let us know the RECFM and LRECL of the file. |
|
Back to top |
|
|
vinodkumar_pallampati
New User
Joined: 29 Jun 2010 Posts: 20 Location: chennai
|
|
|
|
RECFM=FB
LRECL=80
key fields are present in the position (1,10) |
|
Back to top |
|
|
vinodkumar_pallampati
New User
Joined: 29 Jun 2010 Posts: 20 Location: chennai
|
|
|
|
sorry I think DF SORT is not installed in my machine.
because when i execute the teh jcl, mesages are coming as WERxxxB. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
If you have the latest DFSORT version installed then you can use the below code.
Your Input File
Code: |
//SORTJNF2 DD *
9000000000
9000000001
9000000002
9000000004
9000000006
9000000007
|
Another file with all sequence numbers.
Code: |
//SORTJNF1 DD *
9000000000
9000000001
9000000002
9000000003
9000000004
9000000005
9000000006
9000000007
9000000008
9000000009
9000000010
|
SYSIN to create this file:
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL REPEAT=999999999,BUILD=(SEQNUM,10,ZD,START=9000000000)
|
Code: |
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(?,F1:1,10,F2:1,10)
OUTFIL INCLUDE=(1,1,CH,EQ,C'1'),BUILD=(2,80)
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Too late, the DFSORT part of the equation disappeared at 10:42. |
|
Back to top |
|
|
vinodkumar_pallampati
New User
Joined: 29 Jun 2010 Posts: 20 Location: chennai
|
|
|
|
Hi Elango,
I am getting syntax error for the code.please find the error below.
SORT FIELDS=COPY
OUTFIL REPEAT=9999999999,BUILD=(SEQNUM,10,ZD,START=9000000000)
*
WER268A OUTFIL STATEMENT : SYNTAX ERROR
can you please help me. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
vinodkumar_pallampati wrote: |
Hi Elango,
I am getting syntax error for the code.please find the error below.
Code: |
SORT FIELDS=COPY
OUTFIL REPEAT=9999999999,BUILD=(SEQNUM,10,ZD,START=9000000000)
*
WER268A OUTFIL STATEMENT : SYNTAX ERROR |
can you please help me. |
Code tags, please, Vinod. The solution was for DFSORT. Consult your SyncSort manual to establish whether there is a method to do that, also suggest you run through the other sort cards to check on those as well, don't wait to get a file and then find that that doesn't work. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Hi Elango,
I am getting syntax error for the code.please find the error below.
|
WHY DONT YOU UNDERSTAND SOLUTION PROVIDED IS FOR DFSORT NOT SYNCSORT. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
REPEAT= is available in the current release of Syncsort. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
/*
//SORTOUT DD DSN=&&S1,
// DISP=(,PASS,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(10,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REPEAT=0000000009,OVERLAY=(01:SEQNUM,10,ZD)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&S1,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,10,ZD,ADD,+8999999999,EDIT=(TTTTTTTTTT))
/*
|
Amend the REPEAT
Gerry |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
The issue is not with the REPEAT statement but with the sequence start field mentioned.
Quote: |
START - Optionally specifies a starting number n for the field. The n value can be 0 through 2,147,483,647. The default is 1. |
This should fit your requirement.
Code: |
SORT FIELDS=COPY
OUTFIL REPEAT=999999999,OVERLAY=(01:C'9',02:SEQNUM,09,ZD) |
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi kratos86,
I agree your option is easier, what happens when the first number changes from say 8 to a 9.
eq.
range from 8000000000 to 9999999999
Also the REPEAT should be
Code: |
OUTFIL REPEAT=1000000000,OVERLAY=(01:C'9',02:SEQNUM,09,ZD,START=0)
|
Gerry |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
gcicchet wrote: |
what happens when the first number changes from say 8 to a 9.
|
Good question... i never thought this kind of situation will arise since the OP does not mention. This being the case your code will do good with only minimal change. |
|
Back to top |
|
|
|