View previous topic :: View next topic
|
Author |
Message |
surya anem
New User
Joined: 20 Dec 2007 Posts: 54 Location: Hyderabad
|
|
|
|
Hi,
I have a varaible format file which has data like this...
Sample record:
1;199;391;"2009-01-15";978;63;108;
Now i want the record in the below fashion.
1;199;391;2009-01-15;978;63;108;
I mean the single quotes around the character should be removed. They should not be replaced with any spaces. They just have to be removed.
Please let me know how to do this.
with regards,
Surya |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is the recfm vb or is it really fb with records that happen to have different data positions due to the data content? Please post the fd for the file. |
|
Back to top |
|
|
surya anem
New User
Joined: 20 Dec 2007 Posts: 54 Location: Hyderabad
|
|
|
|
dick scherrer wrote: |
Hello,
Is the recfm vb or is it really fb with records that happen to have different data positions due to the data content? Please post the fd for the file. |
This is teh FD for the file
FD LDG-EXTRACT-FILE-V
LABEL RECORDS ARE STANDARD
RECORDING MODE IS V
BLOCK CONTAINS 0 RECORDS
RECORD IS VARYING IN SIZE
FROM 1 TO 250 CHARACTERS
DEPENDING ON WS-REC-LEN. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Are you reading these records or is this the initial write of these records?
In order to remove the double-quotes (and/or any other characters), create a working-storage 01 that will be the "new" data. Using reference modification, loop thru the data that might contain the unwanted characters, and move each "good" character to the new-data area (yuou would use reference modification on both data areas.
When an unwanted character is found, increment the reference modification positon, add 1 to a "skipped" counter, and do not move the character. When a wanted character is found, move the character and increment both reference modification positions.
Continue thr the loop until ws-rec-len has been reached.
If you are writing new output records, subtract the skipped counter from the original length and write the new record with the unwanted characters removed from the new-data area. |
|
Back to top |
|
|
surya anem
New User
Joined: 20 Dec 2007 Posts: 54 Location: Hyderabad
|
|
|
|
Thanks a lot dick Scherrer.
The above logic worked and is easy compared to
other complex logics i thought
Regards,
Surya |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - thanks for the follow-up
d |
|
Back to top |
|
|
|