MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need to select few records when count is known earlier

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Mar 06, 2009 3:57 pm    Post subject: need to select few records when count is known earlier Reply with quote

I have a requirement in which there are many records , the file is 80 bytes FB , the data starts from column 1
Code:

ABC010001
ABC010005
ABC010010
PQR010011
PQR010012
.
.
.

XYZ01
ABC02
.
.
.

What I want is I want to write only 10 records of the combination ABC01 and 10 records of the combination ABC02 to an output
file,I want only 15 records of PQR01 and in a similar way others also ,how can i do this , please help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Mar 06, 2009 4:20 pm    Post subject: Reply with quote

yadav2005,

Use the following control cards

Code:

//SYSIN    DD *                                               
  OPTION EQUALS                                               
  SORT FIELDS=(1,5,CH,A)                                       
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,5))               
  OUTFIL BUILD=(1,80),                                         
  INCLUDE=((1,5,SS,EQ,C'ABC01,ABC02',AND,81,8,ZD,LE,10),OR,   
           (1,5,CH,EQ,C'PQR01',AND,81,8,ZD,LE,15))
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Mar 06, 2009 4:50 pm    Post subject: Reply with quote

Kolusu,

Thanks for your help.

Sorry to tell you I do not have DFSORT I have SYNCSORT and your code is failing if i am using SEQNUM, can you help me further.
Back to top
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Mar 06, 2009 4:57 pm    Post subject: Reply with quote

kolusu,

I am sorry, it is a mistake from my end , SEQNUM works.
Back to top
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Mar 06, 2009 5:25 pm    Post subject: Reply with quote

Kolusu,

I have my records in the file of this fashion and they are sorted in 1-10 columns as well as by company which is col 12 - 14
already.

Code:

----+----1----+----2----+----3----+----4----+----5----+
********************************* Top of Data *********
1190000000|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000010|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000030|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000040|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000050|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000070|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000100|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000120|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000130|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000160|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000220|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000280|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000360|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000400|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000430|11|SPP|SPECIAL-PRODUCT               |FPAVL|
1190000470|11|OPT|OPTIONS PLUS                  |OPTPL|
1190000500|11|OPT|OPTIONS PLUS                  |OPTPL|
.
.
.
.
.
.


I want to select only 15 records of either FPAVL,FPAVU OR FPAVQ as these could be the possible values in col 50 - 54
I want to select only 10 records of either OPTPL,OPRM1 with 11 as the company which is in col 12 - 13
I want to select only 10 records of either OPTPL,OPRM1 with 13 as the company which is in col 12 - 13
I want to select only 15 records of either SOELR as these could be the possible value in col 50 - 54
.
.
and some other conditons.

If i am able to get the desired count , i can write the code further and below is what i am trying: Input dataset LRECL=104
Code:

  SORT FIELDS=COPY
  OUTREC OVERLAY=(105:SEQNUM,8,ZD)
  OUTFIL BUILD=(1,104),
  INCLUDE=((50,5,SS,EQ,C'FPAVL,FPAVU,FPAVQ',AND,105,5,ZD,LE,15),OR,
  (50,5,SS,EQ,C'OPTPL,OPTPQ',AND,105,5,ZD,LE,10),OR,
  (50,5,SS,EQ,C'SOELR',AND,105,5,ZD,LE,15),OR,
  ((50,5,CH,EQ,C'OPRMR,OPRM1',AND,
   12,2,CH,EQ,C'11',AND,
   105,5,ZD,LE,10),OR,
  (50,5,CH,EQ,C'OPRMR,OPRM1',AND,
   12,2,CH,EQ,C'13',AND,
   105,5,ZD,LE,10)),OR,
.
.


I am not getting the desired results and the output count is coming entirely different.
Back to top
View user's profile Send private message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Fri Mar 06, 2009 5:52 pm    Post subject: Reply with quote

Hi Yadav,

by looking your code I noticed that you have reduced the sequence number length to 5 that's why you are not getting the results.

Please change it to 8 and see it will work or not.


INCLUDE=((50,5,SS,EQ,C'FPAVL,FPAVU,FPAVQ',AND,105,8,ZD,LE,15),OR,
(50,5,SS,EQ,C'OPTPL,OPTPQ',AND,105,8,ZD,LE,10),OR,
(50,5,SS,EQ,C'SOELR',AND,105,8,ZD,LE,15),OR,
.
.
.
.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Mar 06, 2009 6:36 pm    Post subject: Reply with quote

yadav2005,

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.

Chandra,

Even if OP changes the length to 8 bytes he will NOT get the desired results. He is just using a seqnum and it will never get him the desired results. He needs to validate 2 fields
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Mon Mar 09, 2009 10:37 am    Post subject: Reply with quote

yadev2005: Based upon the last set of specifications you provided, the following code may help:

Code:
//SYSIN  DD *
 SORT FIELDS=(COPY)
  OUTREC OVERLAY=(105:SEQNUM,5,ZD,RESTART=(50,5))
  OUTFIL BUILD=(1,104),
  INCLUDE=((50,5,SS,EQ,C'FPAVL,FPAVU,FPAVQ',
          AND,105,5,ZD,LE,15),OR,
    ((50,5,SS,EQ,C'OPTPL,OPRM1',AND,
    12,2,CH,EQ,C'11',AND,
    105,5,ZD,LE,10),OR,
    (50,5,SS,EQ,C'OPTPL,OPRM1',AND,
    12,2,CH,EQ,C'13',AND,
    105,5,ZD,LE,10)),OR,
    (50,5,SS,EQ,C'SOELR',AND,105,5,ZD,LE,15))


Note that I added back in the RESTART that kolusu originally suggested, and changed the CH FORMAT to SS from the code you last supplied. I have only tested this with a minimal number of records, so you will need to do further testing using your data.
Hope this helps! Please feel free to contact me directly at zos_tech@syncsort.com if you require further assistance.
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group