different records in a file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

different records in a file

Postby veronikaluv » Wed Mar 26, 2008 11:21 pm

I have something like this: PC
20
30
40
50
60
70
EF
I need to examin the sequentiality of these records-if they appear one after another regularly or there is something missing (each of them are recs of different length, eg. REC20 has
filler pc x, tp-rec pic x(2), val-1 pic x(4) and so on...). It should all be down one 01 level, is it possible to make a table with occurs inside or how to do it? Thanks in advance.
veronikaluv
 
Posts: 7
Joined: Sat Feb 16, 2008 10:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: different records in a file

 

Re: different records in a file

Postby dick scherrer » Wed Mar 26, 2008 11:59 pm

Hello,

Please clarify what you are asking. From what you've posted, your request is not at all clear.

if they appear one after another regularly or there is something missing
What does this mean? How would the code know if something was missing? The "keys" you posted all have values "missing" between themself and the "next" key.

How would you want to use an array?

Once your request is clear, i'm sure someone will be able to offer suggestions.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: different records in a file

Postby veronikaluv » Fri Mar 28, 2008 4:48 pm

on the end I should make a printing file that prints these data.
I have an array or a record set:
PC
10
20
30
50
70
10
20
30
50
70
.
.
.
.
ef

where for eg 10 is: rec10
filler x(1)
tp-rec pic x(2)
field1 x(5)
field2 x(5)
field3 x(12)

other rec20, rec30 ecc are with different lengths but they all start with Filler x(1).
I need to read all the array and verify if after 10 comes 20 , after 20 comes 30, and so on . If there is one of these recs is missing, need to inform a user about it, and then to print out a file with everything written in certain rows.
veronikaluv
 
Posts: 7
Joined: Sat Feb 16, 2008 10:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: different records in a file

Postby dick scherrer » Fri Mar 28, 2008 11:33 pm

Hello,

You seem to be reluctant to post much detail. . . For us to be able to actually help, we really do need a complete explanaton of what you have and what you want to do with it.

Examples (with more than 2-digits of detail) will help explain your requirement. . . You do not need to post all of the detail from all of the record types, but you do need to post enough for someone to understand your requirement.

Keep in mind that while your question is completely clear to you, it will probably not be so clear to others who read it.

on the end I should make a printing file that prints these data.
What is this? Who/what are "these data"?

I have an array or a record set. . .
I need to read all the array
Is there a set of records or is there an array (both?)? How is the array built? How many "sets" of data might there be in the input?

and then to print out a file with everything written in certain rows.
Show how this should be output.

When you post sufficient detail, we will try to suggest ways to get what you need from a process.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post