Page 1 of 1

How to achieve COBOL inspect functionality in Easytrieve

PostPosted: Tue Oct 27, 2009 8:33 pm
by Jagan
Hi All,
I need to get the functionality below.. help me as am new to this EZV...

I/p file:
num name Dept desc
10 ABC A0 - Printing
12 XYZ A1 - Selling
15 ABZ B2 - Packing
25 CFE C3 - Cutting
..................
.............
................


The input file will be as shown above.. i want to generate output as below,

O/p file

name Deptnum
ABC A0
XYZ A1
ABZ B2
CFE C3
......
......
......


Help me in getting the above functionality of unstring a string delimited by show character.

Thanks in advance

Jagan....

Re: How to achieve COBOL inspect functionality in Easytrieve

PostPosted: Wed Oct 28, 2009 12:09 am
by dick scherrer
Hello,

To do this in Easytrieve, define the "input" data area as an array of 1-byte items. Then loop thru the input and do whatever is needed for your requirements.

As the loop proceeds thru the input, move the "unstrung" data to fields that are of the needed "picture".

If all of the data positions are fixed (like the posted example data) there is no need to "unstring". A simple redefinition would work.