Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to findout missing numbers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to findout missing numbers
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    Post subject:
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..

http://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    Post subject:
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    Post subject:
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..
http://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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Wed Sep 28, 2011 4:51 pm    Post subject: Reply to: how to findout missing numbers
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Wed Sep 28, 2011 6:31 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Sep 28, 2011 11:21 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Sep 29, 2011 5:12 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Sep 29, 2011 12:12 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Fault Analyser - missing code explana... egrove IBM Tools 1 Thu Aug 11, 2016 5:55 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts Missing Java main class akg Java & MQSeries 3 Wed May 25, 2016 4:05 pm
No new posts Sort Trick for numbers pshongal DFSORT/ICETOOL 4 Tue Mar 22, 2016 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us