Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to view variable record length data.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Tue Apr 03, 2007 3:47 pm    Post subject: How to view variable record length data.
Reply with quote

Hi,

For my output file i am having layout containing Occurs Clause with Depending On some variable.

Eg:- WS-REC OCCURS 1 TO 15 TIMES
DEPENDING ON WS-CNT.

Now i want to view my output file.
Can anyone please suggest some way in which i can view this.

Thanks.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8619
Location: Back in jolly old England

PostPosted: Tue Apr 03, 2007 3:50 pm    Post subject:
Reply with quote

Type B next to the dataset in 3.4
Back to top
View user's profile Send private message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Tue Apr 03, 2007 4:01 pm    Post subject: Re: How to view variable record length data.
Reply with quote

Hi,

Thanx a lot for the quick reply. May be i didn't framed my question properly.

I want to view my output in the layout in which i moved the values into it. But i had declared the layout in the working section to have Dynamic Array rather than Static one.

Thats y i used Depending On instead of Indexed By...

Since i have declared Dynamic Array for the layout i cannot have it in a copybook.

Now i want to view my output in the same layout which i hav defined in the Working Storage of my Program.

Can you now suggest some way of viewing the output file in the proper layout, not just BROWSE.

I hope this clarifies what is my requirement.

Thanks.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Tue Apr 03, 2007 4:19 pm    Post subject:
Reply with quote

Quote:
Since i have declared Dynamic Array for the layout i cannot have it in a copybook.

Do you have File-aid or Insync installed at your shop? Then use it.
Code:
 02  H-OCC-NO          PIC 99.                           
 02  H-TABLE OCCURS 000 TO 012 TIMES DEPENDING ON       
     H-OCC-NO.

suppose you declared similar variable/s in copybook, it is viewable through FILE-AID.
Reply back if I got your question incorrectly. icon_smile.gif
Back to top
View user's profile Send private message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Tue Apr 03, 2007 4:41 pm    Post subject: Re: How to view variable record length data.
Reply with quote

What you say is correct.

But if there are two occurs Clause one after the other like this:-
Code:
05  CO-CNT                         PIC 9(02).
05  COVERAGE-REC OCCURS 1 TO 15 TIMES       
          DEPENDING ON CO-CNT.
      10  CO-HDR-ID                    PIC X(06)
      10  CO-TYPE                        PIC X(03)           
05  SC-CNT                         PIC 9(02).
05  CONTRIBUTIONS-REC OCCURS 1 TO 24 TIMES
     DEPENDING ON SC-CNT.               
10  SC-HDR-ID                        PIC X(06)
10  SC-TYP-OF-COVERAGE       PIC X(03)       

So in this will the copybook declared in this fasion hold good.
Because by decalring the copybook in the way you have told will take for the maximum number of occurences.

Say for record 1 there are 2 occurences of COVERAGE-REC and 1 occurence of CONTRIBUTIONS-REC.
To view this output the copybook also should be having only 2 occurences of COVERAGE-REC and one occurence of CONTRIBUTIONS-REC.

Will this be possible by declaring in the way mentioned?
Please let me know if you need any other info.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Tue Apr 03, 2007 5:05 pm    Post subject:
Reply with quote

How you are putting data in the file? Try redefining that strucure with individual occurences. (This will destroy very purpose of depending on byt still..)
I havent 'played' much with depending on but trying it now. icon_smile.gif
Try Display required array elements one by one.
Maybe it could help. icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Apr 03, 2007 8:03 pm    Post subject: Re: How to view variable record length data.
Reply with quote

What you have is not legal, the ODO variables must not be in the variable portion of the data. Just move the SC-CNT forward next the outer counter:
Code:
05  CO-CNT                         PIC 9(02).
05  SC-CNT                         PIC 9(02).
05  COVERAGE-REC OCCURS 1 TO 15 TIMES       
          DEPENDING ON CO-CNT.
    10  CO-HDR-ID                  PIC X(06).
    10  CO-TYPE                    PIC X(03).           
05  CONTRIBUTIONS-REC OCCURS 1 TO 24 TIMES
     DEPENDING ON SC-CNT.               
    10  SC-HDR-ID                  PIC X(06).
    10  SC-TYP-OF-COVERAGE         PIC X(03).
kaushik8205 wrote:
To view this output the copybook also should be having only 2 occurences of COVERAGE-REC and one occurence of CONTRIBUTIONS-REC.
Will this be possible by declaring in the way mentioned?
Try it icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 1 Thu Dec 14, 2017 5:46 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us