Can we use occurs depending on in Redfine clause



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

Can we use occurs depending on in Redfine clause

Postby jvinoth » Thu Aug 22, 2013 12:54 pm

Hi,

Can anyone please help on the below issue. Can we use occurs depending on in Redfine clause. Please find below the code.


01 VAR-0 PIC 9(2) VALUE 0.           
01 STRUCT-0 PIC X(26).               
01 STRUCT-1 REDEFINES STRUCT-0.     
    03 VAR-1 PIC X(2).               
    03 VAR-2 OCCURS 10 TIMES         
                DEPENDING ON VAR-0   
                PIC X(1).           
    03 VAR-3 PIC X(14).   



Thanks....

Code'd
jvinoth
 
Posts: 132
Joined: Fri Nov 18, 2011 3:13 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Can we use occurs depending on in Redfine clause

Postby prino » Thu Aug 22, 2013 1:35 pm

Have you actually tried it? And if not, shouldn't you do so before posting here?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Can we use occurs depending on in Redfine clause

Postby NicC » Thu Aug 22, 2013 2:01 pm

You have been asked before to use code tags when posting code, data or anything looking like a screen shot or requiring a fixed pitch font. If you cannot be bothered to use the code tags why should anyone be bothered assisting you?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Can we use occurs depending on in Redfine clause

Postby Robert Sample » Thu Aug 22, 2013 3:03 pm

This is a HELP forum, not a READ-THE-MANUAL-FOR-YOU forum. Your question is rapidly, and accurately, answered in the COBOL Language Reference manual. Since there is a link to that manual at the top right of this page, you can find -- and read -- the manual yourself.

Topic locked.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Can we use occurs depending on in Redfine clause

Postby BillyBoyo » Thu Aug 22, 2013 3:38 pm

The answer can be located easily. but despite that, the equivalent effect can be achieved.

What are you trying to do - in words, what are you trying to get done with the code.

When you call everything "struct" and "var" rather than anything meaningful, I'm not sure it is such a good idea to attempt anything other than the very simple, so you'd best have a good reply.

As the TS you can reply to a locked topic. Just click on the Locked button. If you can't, PM me and I'll open it again.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post