Page 1 of 1

Help on Sort Card

PostPosted: Fri Jun 20, 2014 7:22 pm
by sethukutty
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

Re: Help on Sort Card

PostPosted: Fri Jun 20, 2014 11:24 pm
by sethukutty
I did play around and found the solution using BUILD. Thanks.

Re: Help on Sort Card

PostPosted: Sat Jun 21, 2014 12:13 am
by Terry Heinze
Posting your solution might help others with a similar question.