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
 

 

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 Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am
No new posts File Manager with Variable Length File ahabib IBM Tools 10 Thu Mar 31, 2016 11:00 pm


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