View previous topic :: View next topic
|
Author |
Message |
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
I have a transaction file which contains records like:
:20: IDC025/91889/10
:20: IGT001/17729/09
20C::CORP//4856711
20C::SEME//S10131000086830
20C::PREV//S09237000071115
I have a requirement wherein the input file would contain some values from above file, it would look like:
IDC025/91889/10
CORP//4856711
PREV//S09237000071115
I want to write a sortcard so that if the values in the input file match with the values in the transaction file than the entire transaction record gets copied to an output file. So the output file would look like:
:20: IDC025/91889/10
20C::CORP//4856711
20C::PREV//S09237000071115
Once above output file is created I want to write a 2nd sortcard which would match the output file values with another file (F2). F2 is a variable block file where a '$' sign indicates the start of a record. This is how couple of records in F2 look like:
${1:F01NWBKGB55DXXX2462330811}
{2:O0820901100511DZMNXXXXAXXX00007097091005111001S}
{4:
{202:0001}
{203:0001}
{171:100511}
{175:0900}
{301:RT}
{461:001}}
{5:
{CHK:0C00C5B30333}
{SYS:}}
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}
The output created by the 2nd sortcard should have the entire record from F2 wherein values in the output file created above matches with values in F2. The file would look like:
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}} |
|
Back to top |
|
|
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
wud u mind changing the fields that are getting matched to bold |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
I've changed the fields getting matched to BOLD.
-----------------------------------------------------------
I have a transaction file which contains records like:
:20: IDC025/91889/10
:20: IGT001/17729/09
20C::CORP//4856711
20C::SEME//S10131000086830
20C::PREV//S09237000071115
I have a requirement wherein the input file would contain some values from above file, it would look like:
IDC025/91889/10
CORP//4856711
PREV//S09237000071115
I want to write a sortcard so that if the values in the input file match with the values in the transaction file than the entire transaction record gets copied to an output file. So the output file would look like:
:20: IDC025/91889/10
20C::CORP//4856711
20C::PREV//S09237000071115
Once above output file is created I want to write a 2nd sortcard which would match the output file values with another file (F2). F2 is a variable block file where a '$' sign indicates the start of a record. This is how couple of records in F2 look like:
${1:F01NWBKGB55DXXX2462330811}
{2:O0820901100511DZMNXXXXAXXX00007097091005111001S}
{4:
{202:0001}
{203:0001}
{171:100511}
{175:0900}
{301:RT}
{461:001}}
{5:
{CHK:0C00C5B30333}
{SYS:}}
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}}
The output created by the 2nd sortcard should have the entire record from F2 wherein values in the output file created above matches with values in F2. The file would look like:
${1:F01NWBKGB2LEXXX3423623510}
{2:O2021549100511CIBEEGCXA08540214264501005111349N}
{4:
:20: IDC025/91889/10
:21:BMOC45027677
:32A:100511GBP21816,70
:53B:/04509676
:58A:BARCGB2102L
-}
{5:
{CHK:42C505A4ABD0}} |
|
Back to top |
|
|
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
please mention RECFM and LRECL of all 3 files |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
these are variable block files |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Pankaj,
For the transaction file,does your matching field always start at certain position? If yes, please provide the same.
For the input file,does it only contain matching fields for the transaction file? If yes, starting position for the field?
What is the maximum length of the matching field for both the file?
For the F2 (Variable block file), what is the starting position and maximum length for the matching field?
Also,please use code tags. It helps others understand the input data.
Thanks, |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
sqlcode1,
In the transaction file, the matching field would start from the 16th byte however the length is not fixed since it's a variable block file. The first 15bytes are fixed.
The input file contains matching fields + some more transaction data and as this is also a variable block file so don't know the starting point.
No idea about the maximum length of the matching field as it's a variable block file.
In F2 also we don't know the starting position and maximum length as it's a variable block file. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If "nothing" is known, how might any code be written at all. . .
The first requirement about any kind of code is to know the rules. This is true with assembler, cobol, and utilities (i.e. the sort).
If you cannot describe the rules i don't know how anyone can help. . . |
|
Back to top |
|
|
|