|
View previous topic :: View next topic
|
| Author |
Message |
archana_ssy
New User
Joined: 01 Mar 2010 Posts: 3 Location: LA
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
archana_ssy
New User
Joined: 01 Mar 2010 Posts: 3 Location: LA
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| 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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
archana_ssy
New User
Joined: 01 Mar 2010 Posts: 3 Location: LA
|
|
|
|
After considering the RDW and adding 4 bytes to the positions, it's working fine.
Thank you. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|