SiouxCityElvis
Programmer
Hello. I'm using RMCOBOL-85 on a Linux box.
I need to find a social security number field that would potentially be in a random place in a flat file record.
This data scrubbing is insane to do in COBOL(in my opinion) when Java is touching the file first before sending it to me. Java, from what I understand, has way better features for scrubbing data. But, my reality dictates me to scrub in COBOL.
Example Record.
Here's what I'm thinking about doing...
I'm not sure how I'm going to handle the scenario on each iteration to see if I've reached the end of the line(error handling).
Any suggestions?
Thanks.
-David
I need to find a social security number field that would potentially be in a random place in a flat file record.
This data scrubbing is insane to do in COBOL(in my opinion) when Java is touching the file first before sending it to me. Java, from what I understand, has way better features for scrubbing data. But, my reality dictates me to scrub in COBOL.
Example Record.
Code:
Field One name=Bob address: unknown 111-22-3333 amarillo,tx
Here's what I'm thinking about doing...
Code:
WORKING-STORAGE.
01 CTR-I PIC 999.
01 SW-END-SSN-LINE PIC X VALUE "N".
01 SW-SSN-FOUND PIC X VALUE "N".
01 WS-SCRUB-SSN.
05 WS-SCRUB-SSN3 PIC X(3).
05 WS-SCRUB-SSN-DASH-1 PIC X(1).
05 WS-SCRUB-SSN2 PIC X(2).
05 WS-SCRUB-SSN-DASH-2 PIC X(1).
05 WS-SCRUB-SSN4 PIC X(4).
PROCEDURE DIVISION.
...
...
SSN-LINE-PROCESS.
debug DISPLAY "ON SSN LINE!".
debug DISPLAY "WS-REC: " WS-SAMPLE-REC.
MOVE "N" TO SW-SSN-FOUND, SW-END-SSN-LINE.
MOVE 0 TO CTR-I.
MOVE SPACES TO WS-SCRUB-SSN.
PERFORM UNTIL SW-END-SSN-LINE = "Y"
ADD 1 TO CTR-I
MOVE WS-SAMPLE-REC(CTR-I:11) TO WS-SCRUB-SSN
IF WS-SCRUB-SSN-DASH-1 = "-" AND
WS-SCRUB-SSN-DASH-2 = "-"
MOVE "Y" TO SW-SSN-FOUND, SW-END-SSN-LINE
END-PERFORM.
debug **** ACCEPT MENU-PROMPT.
then do rest of program using flag set for ssn-found or not found.
I'm not sure how I'm going to handle the scenario on each iteration to see if I've reached the end of the line(error handling).
Any suggestions?
Thanks.
-David