To Moderator: Please do not lock this post due to duplication. May be you can lock the one that I posted in Cobol Section by mistake.
I am looking for help on the following request:
I have the following 2 fields in the input file.
1. Application Code-[Length 1 Char]
2. Time (not in consistent format. Basically its hidden in 4 ways)-[Length 8 Char]
I/P file --> O/P file (B denotes Blank) (Let me show how the time is hiding)
W0173504B --> W17:35:04 (If the first Char is W then time starts from 3rd char with the length of 6 in the i/p file)
X1305BBBB --> X13:05:00 (If the first Char is X then time starts from 2nd char with the length of 4 in the i/p file).
Y20B08B57 --> Y20:08:57 (If the first Char is Y then time starts from 2nd char with the length of 8 but there is blank between HH , MM & SS in the i/p file).
Z11555500 --> Z11:55:55 (If the first Char is Z then time starts from 2nd char with the length of 6 in the i/p file)
I want all the O/P in the above format which is App CodeHH:MM:SS
Thanks
Sethu