View previous topic :: View next topic
|
Author |
Message |
rahul.banik
New User
Joined: 23 Jan 2007 Posts: 16 Location: Mysore
|
|
|
|
Hi All,
This is the FILE AID view of a particular field of my input file.
Code: |
EZT0A-05-OPEN-DATE
5/PS
(528-531)
155----------------
*******************
800502
950315
800802
800802
1051116
801202
821102
810202
810202
810302
810302
950809
980115
750502
851002
1020611
1070222
******************* |
This EZT0A-05-OPEN-DATE field is a S9(07) COMP-3 variable and the date format is like CYYMMDD where C represent the century.For 19th C=0 and for 20th C=1.
My requirement is to fetch all the records with DD=02 using SORT.
Thanks,
Rahul |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
rahul.banik,
Quote: |
EZT0A-05-OPEN-DATE field is a S9(07) COMP-3 variable and the date format is like CYYMMDD where C represent the century.For 19th C=0 and for 20th C=1.
My requirement is to fetch all the records with DD=02 using SORT. |
S9(07) COMP-3 will occupy 4 bytes. Let us assume these 4 bytes are in position 1 and length 4. The following DFSORT statements will retrieve the records of DD=02.
Code: |
OPTION COPY
INCLUDE COND=(3,2,BI,EQ,B'....00000010....') |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rahul,
Assuming this means that your 4-byte PD field is in positions 528-530, here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(530,2,PD0,EQ,X'02')
/*
|
|
|
Back to top |
|
|
rahul.banik
New User
Joined: 23 Jan 2007 Posts: 16 Location: Mysore
|
|
|
|
Hi Frank,
Thank you.It is working fine.
Thanks,
Rahul |
|
Back to top |
|
|
|