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 

include record based on range of values

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 21, 2007 11:52 am    Post subject: include record based on range of values Reply with quote

Hi all,

i have a requirement to include values in the range 1-74999.
The field on which the comparsion is being done is pic 9(9)v99

Please let me know anything wrong with this sort card as i am getting unpredictable records in the output



INCLUDE cond=(125,11,CH,GT,C'00000000000',AND,
125,11,CH,LT,C'00000075000')

Regards,
Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon May 21, 2007 12:00 pm    Post subject: Reply with quote

Quote:

Please let me know anything wrong with this sort card as i am getting unpredictable records in the output


1. Do you have imbedded decimal point?
2. is the file variable block file?
3. Show us a sample input along with the wrong output

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 21, 2007 12:17 pm    Post subject: Reply with quote

2) This is variable block file

i am adding 4 bytes to the actual location

i am getting 0's in the output file which i should not have got

In the input file we have values like this

This i have copied from file aid
Code:

ANNUAL-INCOME-UPPER-AMT
11/NUM                 
(121-131)
0
0
100000.00
750000.00
250000.00
100000.00
100000.00

Output file:
Code:

ANNUAL-INCOME-UPPER-AMT
11/NUM                 
(121-131)     

0         

Please let me know if further info required.
if i try to filter through fileaid no records are getting selected but actually in that range values are present

Regards,
Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon May 21, 2007 12:25 pm    Post subject: Reply with quote

jajularamesh,

Show us the data from 3.4 view/edit mode as file-aid adds the decimal point and also truncates the leading zeroes.

1. open the dataset in view/edit mode
2. type cols
3. PF11 to pos 121
4. Copy the contents and paste them here

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 21, 2007 12:35 pm    Post subject: Reply with quote

please find the data in the output file
Code:

-----------------------------------------------------------------
    TPLAN01.TSO9314.SUIT11                          Columns 00121
 ===>                                                  Scroll ===
----+----3----+----4----+----5----+----6----+----7----+----8----+
***************************** Top of Data ***********************
0000000000000010000000000249999000000750000000009999900CAPITAL AP
0000000000000075000000000999999000001000000099999999900INCOME   
0000000000000025000000000749999000000000000000002499900CAPITAL AP
0000000000000010000000000249999000000250000000004999900TAX CONSID
0000000000000010000000000249999000000250000000004999900INCOME   
0000000000000010000000000249999000000000000000002499900INCOME   

Regards
Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon May 21, 2007 12:45 pm    Post subject: Reply with quote

jajularamesh,

Try this include card

Code:

 INCLUDE cond=(125,11,ZD,GE,0,AND,125,11,ZD,LE,75000)


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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 21, 2007 12:59 pm    Post subject: Reply with quote

actually i tried this but i didn't get proper results

however i again ran and please find the output which has zeros which should not be present
The sort card used in JCL is
INCLUDE cond=(125,11,ZD,GT,0,AND,125,11,ZD,LT,75000)
-------------------------------------------------------------------------------
BROWSE TPLAN01.TSO9314.SUIT11 Line 00000000 Col 121 200
Command ===> Scroll ===> CSR
----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
********************************* Top of Data *********************************
0000000000000010000000000249999000000750000000009999900CAPITAL APPRECIATION
0000000000000075000000000999999000001000000099999999900INCOME
0000000000000025000000000749999000000000000000002499900CAPITAL APPRECIATION
0000000000000010000000000249999000000250000000004999900TAX CONSIDERATIONS
0000000000000010000000000249999000000250000000004999900INCOME
0000000000000010000000000249999000000000000000002499900INCOME
0000000000000100000000999999999000001000000099999999900CAPITAL PRESERVATION
0000000000000010000000000249999000001000000099999999900
0000000000000075000000000999999000000000000000002499900
0000000000000100000000999999999000000250000000004999900
0000000000000025000000000749999000001000000099999999900
0000000000000025000000000749999000000000000000002499900CAPITAL PRESERVATION
0000000000000100000000999999999000001000000099999999900CAPITAL PRESERVATION
0000000000000075000000000999999000000000000000000000000
0000000000000010000000000249999000000250000000004999900CAPITAL PRESERVATION
0000000000000025000000000749999000001000000099999999900
0000000000000100000000999999999000000500000000007499900
0000000000000100000000999999999000000000000000002499900
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon May 21, 2007 1:15 pm    Post subject: Reply with quote

jajularamesh,

Just run your job with these control cards and check the contents.

Code:

//SYSIN    DD *             
 SORT FIELDS=COPY           
 OUTFIL VTOF,OUTREC=(125,11)


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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 21, 2007 1:51 pm    Post subject: Reply with quote

Hi Kolusu,

Now i converted the variable block file to fixed block and changed the position to 121 but still i am not getting proper results and o/p file is empty but if i look at the i/p file i could still find the valid data that should be reported to output file is present

However thanks for your replies but i am not sure what is reason for getting errorenous results

Regards,
Ramesh
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun May 27, 2007 11:54 am    Post subject: Reply with quote

Ramesh,

A pic 9(9)v99 value might look like this externally:

123456789.01

In your case, the decimal point is implied, so the same value would look like this in the record:

12345678901

You say you're looking for a range of "1-74999". If that's an integer range, then it wouldn't include the decimal places so 75000 would actually be 00007500000 = 75000.00.

You need to figure out the actual starting position (p) of the 11 bytes for your value. It's difficult to tell from what you've said so far what that starting position is. You seem to think its 125, but nothing you've shown actually has a value that corresponds to that. For example, you show:

Code:

----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
0000000000000075000000000999999000001000000099999999900INCOME
          xxxxxxxxxxx


If the value here is 75000.00, then it would be in the positions shown by the x's so it would start at 131 + 4 (for the RDW) = 135, not 125.

YOU need to figure out where the field really starts - we can't do that for you since we don't have your input data set to look at.

Once you've figured out what p really is, then you can use a DFSORT INCLUDE statement like this:

Code:

   INCLUDE COND=(p,11,ZD,GE,0,AND,
       p,11,ZD,LT,7500000)


Where 7500000 corresponds to 75000.00 if that's what you want.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Mon May 28, 2007 11:39 pm    Post subject: Reply with quote

Hi Frank,

Thanks for the post and this looks to be very informative.yes i have not taken care of the decimal point so i am getting unexpected results.

Now my problem is solved.

Thanks Frank for the solution

Regards,
Venkata Apparao Jajula
Back to top
View user's profile Send private message
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