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
 

 

sampling records from a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 45
Location: Taiwan

PostPosted: Tue Oct 14, 2008 2:40 pm    Post subject: sampling records from a file
Reply with quote

I need to select records from a file for the purpose of auditing.

Code:

001 PB01 00001
001 PB02 00002
001 PB02 00003
001 PB02 00004
001 PB02 00005
001 PB02 00006
002 PB03 00007
002 PB03 00008
002 PB03 00009
003 PB01 00010
003 PB01 00011
003 PB04 00012
003 PB02 00013
003 PB02 00014
003 PB02 00015

The fields of the records are defined as
byte 1-3 means branch number
byte 5-8 means product code
byte 10-14 means the quatity

The criteria of the selection has three conditions :
1: only certain <product codes> are required
2: there is a <threshold> defined for each product code.
a) if the count of the matched record is below or equal to the
threshold , all of them should be selected
b) otherwise, the matched record should only be selected every <N>
records, starting from the first one

The criterial of the selection should be like the following :

Code:

<product code>   <threshold>   <selected frequency>
PB01                   003               002
PB02                   004               003


The expected output should be :
001 PB01 00001
001 PB02 00002
001 PB02 00005
003 PB01 00010
003 PB01 00011
003 PB02 00013
003 PB02 00014
003 PB02 00015

==============================

Anyone care to shed light on the question ?
Back to top
View user's profile Send private message

jacobdng

New User


Joined: 27 Aug 2006
Posts: 45
Location: Taiwan

PostPosted: Tue Oct 14, 2008 2:46 pm    Post subject:
Reply with quote

By the way, we don't have z/OS DFSORT V1R5 PTF UK90013 (July, 2008).

The DFSORT explains itself as Z/OS DFSORT V1R5 !
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 14, 2008 9:28 pm    Post subject:
Reply with quote

jacobdng wrote:
2: there is a <threshold> defined for each product code.
a) if the count of the matched record is below or equal to the
threshold , all of them should be selected
b) otherwise, the matched record should only be selected every <N>
records, starting from the first one



Your output does NOT match to the requirements. Pb02 occured 8 times in the input file. So the count is greater than the threshold. And your frequency is only 3 how did you have 5 records for pb02 in the output?
Back to top
View user's profile Send private message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 45
Location: Taiwan

PostPosted: Wed Oct 15, 2008 7:54 am    Post subject:
Reply with quote

Dear Kolusu,
Your comment is correct.
I forgot to mention that the abovementioned requirements are restricted to the same <branch number>.

Therefore, there will be only 5 records of PB02 to be evaluated for branch 001, and , 3 records of PB02 to be tested for branch 003.

Thanks for your support.

Jacob
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 16, 2008 5:27 am    Post subject:
Reply with quote

jacobdng,

There are still some issues unresolved. Your key PB02 for branch number 001 has 5 records and the threshold is 4 and the frequency is 3. So according to rule 2b, you should have 3 records of PB02 for branch 001. you only show 2 records. Is that a typo?
Back to top
View user's profile Send private message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 45
Location: Taiwan

PostPosted: Thu Oct 16, 2008 8:19 am    Post subject:
Reply with quote

Kolosu,

The evaluation should start from the record "001 PB02 00003 ".
Then, the 2nd & 3rd in the frequency counting should be ignored.
The frequency counting should restart at "001 pb02 00004".
Then, the 2nd of frequency counting should be ignored.

Quote:

001 PB02 00002 *1
001 PB02 00003 2
001 PB02 00004 3
001 PB02 00005 *1
001 PB02 00006 2


The above two records marked with "*" should be sampled out.

Or, do you think I mess up with the definition of frequency counting?

Jacob
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 16, 2008 9:51 pm    Post subject:
Reply with quote

jacobdng,

I am totally at a loss to the new rules. How do you decide where to begin the evaluation for each product code? And what is the criteria to skip records in between. Either way I think this is way too complicated to be done in sort
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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