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
 
Redefine variable initialization

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

New User


Joined: 15 Nov 2007
Posts: 29
Location: Bangalore

PostPosted: Fri Nov 20, 2009 2:42 pm    Post subject: Redefine variable initialization
Reply with quote

HI,
If we redefine a level 01 variable to other level will it be initialized if we are initializing the redefine variables.?
EG:
01 empname pic x(15)
01 emp redefine empname
02 emp-fname pic x(8)
02 emp-mid pic x(3)
02 emp-lname pic x(4)
....
initialize emp-fname,emp-mid ,emp-lname
display "name :" empname

then what will be the ouptput?
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: Fri Nov 20, 2009 4:05 pm    Post subject:
Reply with quote

Why not try it yourself and see the results.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Nov 21, 2009 9:04 am    Post subject:
Reply with quote

Hi Hari,

If those are the variables you'll be actually using, why not

MOVE SPACES TO empname

or better still, get rid of the REDEFINES and

MOVE SPACES TO emp

The O/P, in either case, will be 15 SPACES; use DISPLAY '>' empname (or emp) '<' and the O/P will be:
Code:
>               <
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 values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Easytrive Redefine vidyaa CA Products 4 Mon Jun 19, 2017 6:01 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm

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