|
|
| Author |
Message |
ksk
Senior Member
Joined: 08 Jun 2006 Posts: 315 Location: Pune, India
|
|
|
|
Hi,
We have an input file with 20 Million records. Primary key is combination of Account_ID starting from position 1 to 16 and Record Type from 21-22 postions. Same account number can reside in different record types. In our case we need only 2 record types '01' and '15'.
Our requirement is to read the input file and check for 3 fields (Positions are 108-108, 198-198 and 207-212) from record type '15' and one field from record type '01' (Position 414-414). If any of these fields have valid values i.e., other than spaces, these 2 record types should be written to output file.
NOTE: Record type '01 and '15' have different layouts.
Can we do this using DFSORT?
Here are the details of Input file:
Record length = 1019, Format = VB
Regards,
KSK |
|
| Back to top |
|
 |
References
|
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3725 Location: Brussels once more ...
|
|
|
|
| Code: |
INCLUDE COND=(pos,length,format,operator,condition)
example
INCLUDE COND=(1,2,CH,EQ,C'16')
|
|
|
| Back to top |
|
 |
ksk
Senior Member
Joined: 08 Jun 2006 Posts: 315 Location: Pune, India
|
|
|
|
| Please note that above input file is VSAM file. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3725 Location: Brussels once more ...
|
|
|
|
| Please note that the above example of code will still work |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4675 Location: San Jose, CA
|
|
|
|
KSK,
If I understand what you want correctly, you can use a DFSORT job like the following to do what you want. I assumed you didn't count the 4-byte RDW in the starting positions you gave, so I added 4 to each starting position:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... VSAM input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY,VLSCMP
RECORD TYPE=V
INCLUDE COND=((25,2,CH,EQ,C'15',AND,
(112,1,CH,NE,C' ',OR,202,1,CH,NE,C' ',OR,
211,6,CH,NE,C' '),OR,
(25,2,CH,EQ,C'01',AND,418,1,CH,NE,C' ')))
/*
|
|
|
| Back to top |
|
 |
ksk
Senior Member
Joined: 08 Jun 2006 Posts: 315 Location: Pune, India
|
|
|
|
Frank,
Thanks very much for your solution. It is working fine.
Expat,
I have tried with your suggested soultion but it was giving some length error as it was a VB file. |
|
| Back to top |
|
 |
|
|
|