IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

INCLUDE COND for Comp-3 field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
archana_ssy

New User


Joined: 01 Mar 2010
Posts: 3
Location: LA

PostPosted: Mon Mar 01, 2010 11:47 pm
Reply with quote

Hi,

I have a date field defined as S9(9) comp-3

I want to include records in the outfile with dates GE 20080101 so I defined the SYSIN as

Code:

  SORT FIELDS=COPY
  INCLUDE COND=(1,5,PD,GE,20080101)


This is not working and is copying all the records.
I think I need to conver the PD to ZD but not sure how.

Pleae advice a way to convert & include in the same SYSIN

Thanks,
Archana
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 02, 2010 12:50 am
Reply with quote

That's the correct INCLUDE statement for what you described. So I can only guess that your S9(9) comp-3 field does NOT actually start in position 1. Does your input file have RECFM=VB? If so, then the field starts in position 5 after the RDW so the INCLUDE statement should be:

Code:

  INCLUDE COND=(5,5,PD,GE,20080101)


If that's not it, then tell me the RECFM and LRECL of your input file and show me an example of the values in positions 1-5 of your input records.

Quote:
I think I need to conver the PD to ZD but not sure how.


No, you don't need to do that.
Back to top
View user's profile Send private message
archana_ssy

New User


Joined: 01 Mar 2010
Posts: 3
Location: LA

PostPosted: Tue Mar 02, 2010 1:03 am
Reply with quote

Thanks Frank.
Below are further details -
LRECL=2007,RECFM=VB

Date Filed # 1 starts @904 position
Date field # 2 starts @912

Code:
904      912       <- Position
20080101 99999999  <- Data
20080101 99999999
20071012 99999999

SYSIN
SORT FIELDS=COPY                           
INCLUDE COND=((904,5,PD,GE,20080101),OR,   
             ((912,5,PD,GE,20080101),AND,   
              (912,5,PD,NE,99999999)))     


Thanks,
Archana
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Mar 02, 2010 1:48 am
Reply with quote

archana_ssy wrote:
Thanks Frank.
Below are further details -
LRECL=2007,RECFM=VB

Date Filed # 1 starts @904 position
Date field # 2 starts @912


Did you consider the RDW when calculated the position 904? If not you need to add 4 bytes to the actual position as the actual data in a VB file starts at position 5. The first 4 bytes will be the RDW
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 02, 2010 2:04 am
Reply with quote

If 904 and 912 are the data positions, then you need to add 4 to each to account for the RDW in positions 1-4.

Code:

  SORT FIELDS=COPY                           
  INCLUDE COND=((912,5,PD,GE,20080101),OR,   
             ((916,5,PD,GE,20080101),AND,   
              (916,5,PD,NE,99999999)))


However, what you are showing in your example are ZD values, not PD values. You'd have to show the values in hex for us to verify that they are actually PD values.
Back to top
View user's profile Send private message
archana_ssy

New User


Joined: 01 Mar 2010
Posts: 3
Location: LA

PostPosted: Tue Mar 02, 2010 2:27 am
Reply with quote

After considering the RDW and adding 4 bytes to the positions, it's working fine.

Thank you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top