VB to VB copy with conditions.

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Previous topicNext topic

Topic Author
B Mkote
New Member
Posts: 6
Joined: Thu Mar 19, 2015 1:52 pm

VB to VB copy with conditions.

Post by B Mkote » Fri Sep 04, 2015 2:46 pm

Hi,

I have one requirement. I want to extract only specific fields based on some criteria from VB file to another VB file.

Code: Select all

Field name	Length	Type	             Starting Positions 
Exepno	    7        Numeric	          1 
Exename	   20       Character	        10 
Salary	    8        Float(9(6)v99)      32 
Designation  20	    Character           41 
I want to extract the records which are having salary greater than 200000 or Designation as Quality Engineer to Variable block file.

Code: Select all

SORT FIELDS=(45,20,CH,A) 
  INCLUDE COND=((36,8,PD,GE,200000),OR, 
                         (45,20,CH,EQ,C'QUALITY ENGINEER')) 
But it writes all the records from inout to output. Can you please guie on this.




William Collins
Global Moderator
Global Moderator
Posts: 499
Joined: Sun Aug 25, 2013 7:24 pm

Re: VB to VB copy with conditions.

Post by William Collins » Fri Sep 04, 2015 4:43 pm

What told you your salary was "FLOAT"? PD is not FLOAT. A PD of eight bytes would not be 9(6)V99.

Can you show a sample of your data if you still have problems?



User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1379
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: VB to VB copy with conditions.

Post by Robert Sample » Fri Sep 04, 2015 6:00 pm

Your comparison is very wrong. A 9(6)V99 value of 200000 would appear to SORT as 20000000 (note the extra two zeroes) as the V is an implied decimal point. Implied means it doesn't really exist and therefore the data appears to be 100 times larger than the "true" value. If none of your salary values is less than 2000, then every record would match the first part of your condition and be selected.



Previous topicNext topic

Return to “SyncSort, SyncTool, SyncGener.”