|
View previous topic :: View next topic
|
| Author |
Message |
sudib19
New User
Joined: 06 Feb 2007 Posts: 29 Location: Noida
|
|
|
|
Hi,
I have an input FB file of 200 record length, which looks like this
| Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3--
ACCT: A...XXXXX JOHNDON A........ 1...BARD-GRAM CIR..............NAT.......L....40...100.................9999-999-0000
ACCT: A...YYYYY JOHNDON B........ 1...WARD GRAM ST...............NAT.......L....40...100.................9999-999-0000
ACCT: A...ZZZZZ JOHNDON C........ 1...SOUTH ST...................NAT.......L....40...100.................9999-999-0000
|
I want to extract the records which have a space in between the words from position 53 to 79 just before any of these characters
ACR, ALY, APR, APT, AVE, BCH, BLF, BLV, BND, BRG, BRK, BWY, CIR, CLF, CLS, COM, CON, COR, CRT, CST, CT, CTF, CTR, CV, CY, DR, E, EL, END, EST, EXP, EXT, FLD, FLT, FRM, FRS, FUR, GDN,GLA, GLN, GRN, GRV, GT, HBR, HGL, HL, HLS, HLW, HOL, HTS, HVN, HWY, IS, ISL, KNL, LK, LN, LND, MDW, MWS, N, NCK, NS, OVA, PD, PIK, PK, PKY, PL, PLN, PLZ, PNE, PSS, PT, PTH, RD, RDG, RDY, RIV, ROW, RS, RUN, S, SHL, SHR, SLP, SQ, ST, STR, TER,TPK, TRL, TWR, VLG, VLY, VW, W, WAY, WLK, XIN
For Example in the above code I have BARD-GRAM CIR which is valid, however in the next record it has WARD GRAM ST which is incorrect. I want to have these types of records in my output file with the same record layout as my input. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I have some questions/clarifications:
What do the dots in the records represent (spaces, binary zeros, something else-what)?
If each word preceded by blank in your record has word in the list, then you want to keep the record - right?
If any word preceded by blank in your record does not have word in the list, then you want to delete the record - right?
The second record should be deleted because it has bGRAM and GRAM is not in the list, even though it also has bST and ST is in the list - right?
The third record should be kept because it only has bST and ST is in the list - right?
Your example has a maximum of three words in the field. Is 3 the actual maximum or can there be more than 3 words in a field - how many? |
|
| Back to top |
|
 |
sudib19
New User
Joined: 06 Feb 2007 Posts: 29 Location: Noida
|
|
|
|
Hi Frank,
Dots represent low values.
The format from record 53 is a Street Name followed by any of the suffixes like ST, CIR etc.
The Street name can be of any length followed by any of the suffixes, so there is not fixed length of the Street Names, but the Street Name will be followed by any of the suffixes as I have listed above.
The suffixes have a maximum length of 3, there would be a space after the Street Name and the Suffix.
Thanks
Sudib |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sudib19,
Use the following DFSORT JCL which will give you the desired results
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input FB 200 LRECL file,DISP=SHR
//GOOD DD SYSOUT=*
//BAD DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(201:53,27)),
IFTHEN=(WHEN=INIT,PARSE=(%=(ABSPOS=201,ENDAT=C' '),%01=(FIXLEN=3)),
OVERLAY=(230:%01)),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=230,INOUT=(X'00',X'40')))
OUTFIL FNAMES=BAD,BUILD=(1,200),SAVE
OUTFIL FNAMES=GOOD,BUILD=(1,200),
INCLUDE=(230,3,CH,EQ,C'E ',OR,
230,3,CH,EQ,C'S ',OR,
230,3,CH,EQ,C'N ',OR,
230,3,CH,EQ,C'W ',OR,
230,3,CH,EQ,C'CT ',OR,
230,3,CH,EQ,C'CV ',OR,
230,3,CH,EQ,C'DR ',OR,
230,3,CH,EQ,C'EL ',OR,
230,3,CH,EQ,C'GT ',OR,
230,3,CH,EQ,C'HL ',OR,
230,3,CH,EQ,C'IS ',OR,
230,3,CH,EQ,C'LK ',OR,
230,3,CH,EQ,C'LN ',OR,
230,3,CH,EQ,C'NS ',OR,
230,3,CH,EQ,C'PD ',OR,
230,3,CH,EQ,C'PK ',OR,
230,3,CH,EQ,C'PL ',OR,
230,3,CH,EQ,C'PT ',OR,
230,3,CH,EQ,C'RD ',OR,
230,3,CH,EQ,C'RS ',OR,
230,3,CH,EQ,C'SQ ',OR,
230,3,CH,EQ,C'ST ',OR,
230,3,CH,EQ,C'VW ',OR,
230,3,CH,EQ,C'ACR',OR,
230,3,CH,EQ,C'ALY',OR,
230,3,CH,EQ,C'APR',OR,
230,3,CH,EQ,C'APT',OR,
230,3,CH,EQ,C'AVE',OR,
230,3,CH,EQ,C'BCH',OR,
230,3,CH,EQ,C'BLF',OR,
230,3,CH,EQ,C'BLV',OR,
230,3,CH,EQ,C'BND',OR,
230,3,CH,EQ,C'BRG',OR,
230,3,CH,EQ,C'BRK',OR,
230,3,CH,EQ,C'BWY',OR,
230,3,CH,EQ,C'CIR',OR,
230,3,CH,EQ,C'CLF',OR,
230,3,CH,EQ,C'CLS',OR,
230,3,CH,EQ,C'COM',OR,
230,3,CH,EQ,C'CON',OR,
230,3,CH,EQ,C'COR',OR,
230,3,CH,EQ,C'CRT',OR,
230,3,CH,EQ,C'CST',OR,
230,3,CH,EQ,C'CTF',OR,
230,3,CH,EQ,C'CTR',OR,
230,3,CH,EQ,C'END',OR,
230,3,CH,EQ,C'EST',OR,
230,3,CH,EQ,C'EXP',OR,
230,3,CH,EQ,C'EXT',OR,
230,3,CH,EQ,C'FLD',OR,
230,3,CH,EQ,C'FLT',OR,
230,3,CH,EQ,C'FRM',OR,
230,3,CH,EQ,C'FRS',OR,
230,3,CH,EQ,C'FUR',OR,
230,3,CH,EQ,C'GDN',OR,
230,3,CH,EQ,C'GLA',OR,
230,3,CH,EQ,C'GRN',OR,
230,3,CH,EQ,C'GRV',OR,
230,3,CH,EQ,C'HBR',OR,
230,3,CH,EQ,C'HGL',OR,
230,3,CH,EQ,C'HLS',OR,
230,3,CH,EQ,C'HLW',OR,
230,3,CH,EQ,C'HOL',OR,
230,3,CH,EQ,C'HTS',OR,
230,3,CH,EQ,C'HVN',OR,
230,3,CH,EQ,C'HWY',OR,
230,3,CH,EQ,C'ISL',OR,
230,3,CH,EQ,C'KNL',OR,
230,3,CH,EQ,C'LND',OR,
230,3,CH,EQ,C'MDW',OR,
230,3,CH,EQ,C'MWS',OR,
230,3,CH,EQ,C'NCK',OR,
230,3,CH,EQ,C'OVA',OR,
230,3,CH,EQ,C'PIK',OR,
230,3,CH,EQ,C'PKY',OR,
230,3,CH,EQ,C'PLN',OR,
230,3,CH,EQ,C'PLZ',OR,
230,3,CH,EQ,C'PNE',OR,
230,3,CH,EQ,C'PSS',OR,
230,3,CH,EQ,C'PTH',OR,
230,3,CH,EQ,C'RDG',OR,
230,3,CH,EQ,C'RDY',OR,
230,3,CH,EQ,C'RIV',OR,
230,3,CH,EQ,C'ROW',OR,
230,3,CH,EQ,C'RUN',OR,
230,3,CH,EQ,C'SHL',OR,
230,3,CH,EQ,C'SHR',OR,
230,3,CH,EQ,C'SLP',OR,
230,3,CH,EQ,C'STR',OR,
230,3,CH,EQ,C'TER',OR,
230,3,CH,EQ,C'TPK',OR,
230,3,CH,EQ,C'TRL',OR,
230,3,CH,EQ,C'TWR',OR,
230,3,CH,EQ,C'VLG',OR,
230,3,CH,EQ,C'VLY',OR,
230,3,CH,EQ,C'WAY',OR,
230,3,CH,EQ,C'WLK',OR,
230,3,CH,EQ,C'XIN')
//* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|