Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is this RENAMES code valid?

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

New User


Joined: 22 Nov 2007
Posts: 13
Location: Noida

PostPosted: Mon Jan 04, 2010 5:05 pm    Post subject: Is this RENAMES code valid?
Reply with quote

Is this RENAMES code valid?

01 RECORD-3.
05 FIELD-1.
10 FIELD11 PIC X(5).
10 FIELD12 PIC X(5).
05 FIELD-2.

66 RECORD-4 RENAMES FIELD12 THRU FIELD-2.
Back to top
View user's profile Send private message

expat

Global Moderator


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

PostPosted: Mon Jan 04, 2010 5:08 pm    Post subject:
Reply with quote

What happened when you tried it youself ?
Back to top
View user's profile Send private message
kshirabdhi

New User


Joined: 22 Nov 2007
Posts: 13
Location: Noida

PostPosted: Mon Jan 04, 2010 5:10 pm    Post subject:
Reply with quote

I did't try it... dont have mainframe connection icon_sad.gif

I have read in a book that this code is invalid!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Mon Jan 04, 2010 5:57 pm    Post subject:
Reply with quote

As you've coded it, compilation fails. However, it fails because you don't have an elementary item under FIELD-2 group item (and since FIELD-2 does not have a picture clause, it must be a group item). Once you define an elementary variable under FIELD-2, the code compiles just fine and executes under Enterprise COBOL. The issue is NOT the RENAMES but the FIELD-2 definition.
Back to top
View user's profile Send private message
kshirabdhi

New User


Joined: 22 Nov 2007
Posts: 13
Location: Noida

PostPosted: Mon Jan 04, 2010 6:12 pm    Post subject:
Reply with quote

I forgot to write the PIC clause for FIELD-2.

Thank you Robert. I wanted to confirm if the code works fine.
Back to top
View user's profile Send private message
kshirabdhi

New User


Joined: 22 Nov 2007
Posts: 13
Location: Noida

PostPosted: Mon Jan 04, 2010 6:14 pm    Post subject:
Reply with quote

One more quick query .... if FIELD-2 is an elementary item, will it give compilation error?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8002
Location: Bellevue, IA

PostPosted: Mon Jan 04, 2010 6:29 pm    Post subject:
Reply with quote

Quote:
One more quick query .... if FIELD-2 is an elementary item, will it give compilation error?
Nope -- FIELD-2 PIC X(10) compiles just fine.
Back to top
View user's profile Send private message
kshirabdhi

New User


Joined: 22 Nov 2007
Posts: 13
Location: Noida

PostPosted: Mon Jan 04, 2010 6:35 pm    Post subject:
Reply with quote

Thanks Robert.
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us