View previous topic :: View next topic
|
Author |
Message |
bhoja
New User
Joined: 31 Jan 2006 Posts: 49
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
You can use the following sort card to do this
//SYSIN DD *
SORT FIELDS=COPY,STOPAFT=35000 |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Or you may use IDCAMS with REPRO and COUNT. |
|
Back to top |
|
|
bhoja
New User
Joined: 31 Jan 2006 Posts: 49
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
bhoja
New User
Joined: 31 Jan 2006 Posts: 49
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
bhoja
New User
Joined: 31 Jan 2006 Posts: 49
|
|
|
|
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 |
|
|
|