Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNSTRING and OCCURS ARRAY

Status
Not open for further replies.

Jsadas

Programmer
May 27, 2003
31
0
0
US
I am receiving a string of 3000 bytes (variable length) with delimiters from Unix. They correspond to 15 fields, 14th and 15th repeat 20 times.

My requirement is to unstring and remove delimiters.

Ex:
12345;678;ABCD;EF;12AC;1;AA;2;AB;3;AC
123;678;ABC;E;12A;10;AAA;20;ABC;30;ACC

The above two records should be moved to cobol variables
Name Value
Rec1 Rec2
Field1 12345 123
Field2 678 678
Field3 ABCD ABC
Field4 EF E
Field5 12AC 12A
Field6(1) 1 10
Field7(1) AA AAA
Field6(2) 2 AB
Field7(2) AB ABC
Field6(3) 3 10
Field7(3) AC ACC

Appreciate your help.
 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am stuck on how to proceed... I just think I need to use UNSTRING, but how is the question?
 
Have a look at this:
faq209-5343

I think you can apply the technique there, and add your own bits to deal with array...

Tom Morrison
 
Thank you for the suggestions...
I have sucessfully implemented using UNSTRING and POINTER, POINTER was really helpful, as I have a two dimensional array in the TO layout.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top