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

If the record count is > 35,000 then I have to ignore oth


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Fri Jun 29, 2007 3:34 pm
Reply with quote

I have a file, it is having more records.
My requirement is if the record count is more than 35,000 then I have to ignore all the remaining records.



Raj
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Jun 29, 2007 3:42 pm
Reply with quote

You can not ignore as such but you can input only required number of records to the program.
add following sort step before your program step-
Code:
//STEP01   EXEC PGM=SORT
//SYSOUT   DD   SYSOUT=*
//IN       DD   DSN=Input,DISP=SHR
//OUT      DD   DSN=Output,DISP=SHR
//SYSIN    DD   *
   OPTION=COPY,STOPAFT=35000
/*

give OUT file as input to your step.
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Fri Jun 29, 2007 3:47 pm
Reply with quote

You can use the following sort card to do this

//SYSIN DD *
SORT FIELDS=COPY,STOPAFT=35000
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Fri Jun 29, 2007 3:49 pm
Reply with quote

Or you may use IDCAMS with REPRO and COUNT.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Fri Jun 29, 2007 5:00 pm
Reply with quote

Thanks for the update
Sorry,
I have not mentioned one point on that.
The file contains products like A, B, C,....etc.
and each product is having more than 35,000 records.
My sortout file should contain all the products of 35,000records.
means,product A should be 35000, product B should be 35000 and C should be 35000.
Do you have any idea on this.

Thanks
Raj
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jun 29, 2007 8:09 pm
Reply with quote

What do you mean by a "product"?

Are the records sorted by "product"?

Please show an example of the records in the input file (just a few records for each "product") and what you expect for output. Give the starting position, length and format of the relevant fields. Give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Sat Jun 30, 2007 10:01 pm
Reply with quote

Hi,
Product means it is store number
It is a sorted file. its LRECL is 131, and key is store number
The input file is like this,

1234ffffbabnbnnbnneennnbnndnbnn
1234gbnnsmbnms/mnmmsmn
1234d gbfgnmfgmnmfgmngnm
1234ggnsgsmnsnsdgndhrngdfn
1234gnbfgfmnmgnfsfmmmfmh
2345dgbnnhnhnitthithninngndgnb
2345fgnngjgohjjthjsohinjoghijfhnfgf
2345fgnkxfgnnnnngknnknggnknkg
2345xgfbngnfnxggndgdkngkidndfg
2345dgbnxnhnknxkgghnnkxghgkn
2345xfjhnmngghxnk.xgfghnknkxhkn
.
.
.
.
.
.

in this 1234, 2345 ..are all store numbers.
Each store is having more than 35000 records.
My requirement is to copy only 35000 records from each store into one output file.

Raj
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Jul 01, 2007 8:21 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/131)
//SORTOUT DD DSN=...  output file (FB/131)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(132:SEQNUM,8,ZD,RESTART=(1,4))
  OUTFIL INCLUDE=(132,8,ZD,LE,+35000),
    BUILD=(1,131)
/*
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Sun Jul 01, 2007 9:19 pm
Reply with quote

Thank you very much Frank.
I will try this code. If I faced any problem I will come back to you.

Raj
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top