IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to findout missing numbers


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinodkumar_pallampati

New User


Joined: 29 Jun 2010
Posts: 20
Location: chennai

PostPosted: Wed Sep 28, 2011 3:48 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 28, 2011 3:50 pm
Reply with quote

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
View user's profile Send private message
vinodkumar_pallampati

New User


Joined: 29 Jun 2010
Posts: 20
Location: chennai

PostPosted: Wed Sep 28, 2011 3:55 pm
Reply with quote

yes DF Sort installed. can you please tell me how to do it.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 28, 2011 3:59 pm
Reply with quote

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
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Sep 28, 2011 4:07 pm
Reply with quote

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
View user's profile Send private message
vinodkumar_pallampati

New User


Joined: 29 Jun 2010
Posts: 20
Location: chennai

PostPosted: Wed Sep 28, 2011 4:09 pm
Reply with quote

RECFM=FB
LRECL=80
key fields are present in the position (1,10)
Back to top
View user's profile Send private message
vinodkumar_pallampati

New User


Joined: 29 Jun 2010
Posts: 20
Location: chennai

PostPosted: Wed Sep 28, 2011 4:12 pm
Reply with quote

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
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Sep 28, 2011 4:46 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 28, 2011 4:51 pm
Reply with quote

Too late, the DFSORT part of the equation disappeared at 10:42.
Back to top
View user's profile Send private message
vinodkumar_pallampati

New User


Joined: 29 Jun 2010
Posts: 20
Location: chennai

PostPosted: Wed Sep 28, 2011 6:27 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 28, 2011 6:31 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 28, 2011 6:32 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Sep 28, 2011 11:21 pm
Reply with quote

Hello,

REPEAT= is available in the current release of Syncsort.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 29, 2011 5:12 am
Reply with quote

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
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu Sep 29, 2011 10:27 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 29, 2011 12:12 pm
Reply with quote

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
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu Sep 29, 2011 12:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Find missing sequence for every key DFSORT/ICETOOL 3
No new posts commands missing in JESMSGLG JCL & VSAM 3
No new posts EDCICONV - Newline are missing All Other Mainframe Topics 6
Search our Forums:

Back to Top