VB to VB copy with conditions.

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
B Mkote
New Member
Posts: 6
Joined: Thu Mar 19, 2015 1:52 pm

VB to VB copy with conditions.

Post by B Mkote »

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: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: VB to VB copy with conditions.

Post by William Collins »

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: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: VB to VB copy with conditions.

Post by Robert Sample »

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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”