SiouxCityElvis
Programmer
I've been trying to get a File to UNSTRING when the line sequential file is TAB delimited. The boss wants these files to be queued to me in TAB delimited, so I've got to conquer this challenge.
My problem happens EXACTLY the same way thread209-686046 had the problem. Unfortunately, I still am getting the and want to verify my raw data is indeed TAB delimited. I think the best way to verify this would be if my Vi editor would somehow let me "view" it in hex format.
Please let me know if anyone knows how to view in hex format with Vi editor.
In addition the following is my code...
SELECT ACH-INPUT ASSIGN TO
"/fp/data/import/achqueue/ACHTest.txt"
ORGANIZATION IS LINE SEQUENTIAL
ACCESS IS SEQUENTIAL.
....
WORKING-STORAGE SECTION.
....
01 WS-TAB PIC X(01) VALUE X'09'.
.....
PROCEDURE DIVISION.
...
new UNSTRING-RAW-ACH-DATA.
MOVE SPACES TO WS-DETAIL-RECORD.
MOVE SPACES TO DETAIL-RECORD.
debug DISPLAY ACH-INPUT-RECORD LINE 1 POSITION 1
ERASE EOS.
debug ACCEPT MENU-PROMPT LINE 2 POSITION 1.
UNSTRING ACH-INPUT-RECORD DELIMITED BY WS-TAB
INTO
WS-FP-ACT-NBR
WS-PAYOR-NAME
WS-ABA
WS-ACCOUNT
WS-PAYEE-NAME
WS-ESCROW-ABA
WS-ESCROW-ACCT
WS-FINAL-ABA
WS-FINAL-ACCT
WS-ORIG-CHECK-NBR
WS-CHECK-AMOUNT
WS-TRANS-TYPE
WS-TRAN-DATE
WS-STATEMENT-DESCR
END-UNSTRING.
debug ** DISPLAY WS-TABBED-DATA LINE 1 POSITION 1 ERASE EOS.
DISPLAY WS-FP-ACT-NBR LINE 1 POSITION 1 ERASE EOS.
DISPLAY WS-PAYOR-NAME LINE 2 POSITION 1.
DISPLAY WS-ABA LINE 3 POSITION 1.
DISPLAY WS-ACCOUNT LINE 4 POSITION 1.
DISPLAY WS-PAYEE-NAME LINE 5 POSITION 1.
DISPLAY WS-ESCROW-ABA LINE 6 POSITION 1.
DISPLAY WS-ESCROW-ACCT LINE 7 POSITION 1.
DISPLAY WS-FINAL-ABA LINE 8 POSITION 1.
DISPLAY WS-FINAL-ACCT LINE 9 POSITION 1.
DISPLAY WS-ORIG-CHECK-NBR LINE 10 POSITION 1.
DISPLAY WS-CHECK-AMOUNT LINE 11 POSITION 1.
DISPLAY WS-TRANS-TYPE LINE 12 POSITION 1.
DISPLAY WS-TRAN-DATE LINE 13 POSITION 1.
DISPLAY WS-STATEMENT-DESCR LINE 14 POSITION 1.
ACCEPT MENU-PROMPT LINE 17 POSITION 1.
I've tried using WS-TAB defined as X'05' and X'09'. Nothing seems to work.
So, I'm concluding that something is wrong with the way the raw data is being brought in and the TABS are missing, or something else.
Thanks.
-David
My problem happens EXACTLY the same way thread209-686046 had the problem. Unfortunately, I still am getting the and want to verify my raw data is indeed TAB delimited. I think the best way to verify this would be if my Vi editor would somehow let me "view" it in hex format.
Please let me know if anyone knows how to view in hex format with Vi editor.
In addition the following is my code...
SELECT ACH-INPUT ASSIGN TO
"/fp/data/import/achqueue/ACHTest.txt"
ORGANIZATION IS LINE SEQUENTIAL
ACCESS IS SEQUENTIAL.
....
WORKING-STORAGE SECTION.
....
01 WS-TAB PIC X(01) VALUE X'09'.
.....
PROCEDURE DIVISION.
...
new UNSTRING-RAW-ACH-DATA.
MOVE SPACES TO WS-DETAIL-RECORD.
MOVE SPACES TO DETAIL-RECORD.
debug DISPLAY ACH-INPUT-RECORD LINE 1 POSITION 1
ERASE EOS.
debug ACCEPT MENU-PROMPT LINE 2 POSITION 1.
UNSTRING ACH-INPUT-RECORD DELIMITED BY WS-TAB
INTO
WS-FP-ACT-NBR
WS-PAYOR-NAME
WS-ABA
WS-ACCOUNT
WS-PAYEE-NAME
WS-ESCROW-ABA
WS-ESCROW-ACCT
WS-FINAL-ABA
WS-FINAL-ACCT
WS-ORIG-CHECK-NBR
WS-CHECK-AMOUNT
WS-TRANS-TYPE
WS-TRAN-DATE
WS-STATEMENT-DESCR
END-UNSTRING.
debug ** DISPLAY WS-TABBED-DATA LINE 1 POSITION 1 ERASE EOS.
DISPLAY WS-FP-ACT-NBR LINE 1 POSITION 1 ERASE EOS.
DISPLAY WS-PAYOR-NAME LINE 2 POSITION 1.
DISPLAY WS-ABA LINE 3 POSITION 1.
DISPLAY WS-ACCOUNT LINE 4 POSITION 1.
DISPLAY WS-PAYEE-NAME LINE 5 POSITION 1.
DISPLAY WS-ESCROW-ABA LINE 6 POSITION 1.
DISPLAY WS-ESCROW-ACCT LINE 7 POSITION 1.
DISPLAY WS-FINAL-ABA LINE 8 POSITION 1.
DISPLAY WS-FINAL-ACCT LINE 9 POSITION 1.
DISPLAY WS-ORIG-CHECK-NBR LINE 10 POSITION 1.
DISPLAY WS-CHECK-AMOUNT LINE 11 POSITION 1.
DISPLAY WS-TRANS-TYPE LINE 12 POSITION 1.
DISPLAY WS-TRAN-DATE LINE 13 POSITION 1.
DISPLAY WS-STATEMENT-DESCR LINE 14 POSITION 1.
ACCEPT MENU-PROMPT LINE 17 POSITION 1.
I've tried using WS-TAB defined as X'05' and X'09'. Nothing seems to work.
So, I'm concluding that something is wrong with the way the raw data is being brought in and the TABS are missing, or something else.
Thanks.
-David