View previous topic :: View next topic
|
Author |
Message |
nivasaya
New User
Joined: 03 May 2007 Posts: 27 Location: India
|
|
|
|
Dear Team,
Please help me in sorting out the I/P file to 2 O/P file-
1)Select the latest CUST-NUM from the file to O/P2
Organization . . . : PS
Record format . . . : VB
Record length . . . : 3640
Block size . . . . : 27998
CUST-NUM Update-Date
20/AN 6/NUM
(23-42) (3490-3495)
5------------------ 910-----------
0000010000AA0101001 2009234
0000010000AA0101001 2009239
000000000000S01D123 2009123
000000000000S01D123 2009239
O/P 1
CUST-NUM Update-Date
20/AN 6/NUM
(23-42) (3490-3495)
5------------------ 910-----------
0000010000AA0101001 2009239 latest
000000000000S01D123 2009239 latest
2) Move the Data from O/P1 to O/P2
O/P 2 - flat file of length - 300
Move O/P1(22:20) to O/P2(1:20)
Move O/P1((3490:6) to O/P2(22:6)
Thanks & Regards,
Niviasaya |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I can't figure out what you want to do. It's not clear what your records look like. You mention various positions such as 20, 23-42, 910, 3490-3495, 22:20, 1:20, 3490:6 and 22:6. All of that different notation makes it difficult to understand what positions you're talking about. Also, since the input file is VB, the first data byte starts at position 5, not position 1 and I don't think you've taken that into account when giving the starting positions.
Please indicate clearly and in straightforward notation the starting position, length and format of each relevant field taking the RDW in positions 1-4 into account. Explain the "rules" for getting from input to output.
What do you mean by the "latest CUST-NUM"? Do you mean the highest NUM value for duplicate CUST-NUM values?
Do all of your records contain the NUM value or can you have "short" records that end before the NUM value? If so, what do you want to do about those "short" records? Do you want to remove them or use blanks for the NUM value or what? |
|
Back to top |
|
|
nivasaya
New User
Joined: 03 May 2007 Posts: 27 Location: India
|
|
|
|
Hi Frank and Team,
I/P file
CUST-NUM PIC X(20) --> Postion - (23-42)
Update-Date PIC 9(06) --> Postion - (3490-3495)
1) Rule 1: for O/P 1
select the reccord with the Latest date and eliminate the other records for each CUST-NUM
2) Rule 1: for O/P 2
Move O/P1(27:20) to O/P2(1:20)
Move O/P1((3495:6) to O/P2(21:6)
similarly other fields.
Hope this info will give a fair idea.
Thank you all in advance,
Nivisaya |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Hope this info will give a fair idea. |
Not really. Please address everything in my previous post. |
|
Back to top |
|
|
|