IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Why shoud we use 'move low-value' before 'initialize'?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
william51
Warnings : 1

New User


Joined: 06 Jul 2006
Posts: 31

PostPosted: Mon Aug 14, 2006 10:30 am
Reply with quote

I saw below statements in source program
MOVE LOW-VALUE TO FIELDA.
INITIALIZE FIELDA.
Why shoud we use 'move low-value' before 'initialize'?why not use 'initialize' directly?
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Aug 14, 2006 8:20 pm
Reply with quote

There is no reason to use 'MOVE LOW-VALUES'. It's overlayed by 'INITIALIZE'

Dave
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Aug 15, 2006 5:04 am
Reply with quote

Hi,

If the field has FILLERs and low vals are desired in those parts of the field, then that's the way to do it.
Back to top
View user's profile Send private message
william51
Warnings : 1

New User


Joined: 06 Jul 2006
Posts: 31

PostPosted: Tue Aug 15, 2006 8:45 am
Reply with quote

mmwife,
Do you mean that the INITIALIZE statement can't give the FILLERS default value?
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Aug 15, 2006 7:45 pm
Reply with quote

Jack is absolutely correct, filler fields are unaffected by ?INITIALIZE?

Dave
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Sat Aug 19, 2006 5:47 pm
Reply with quote

so what is the reason to add initialize after moving low value .The first statment itself can do the initialization so what is the need of second
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 19, 2006 9:09 pm
Reply with quote

A low-vals MOVE fills the entire field w/binary zeros. The INIT will overlay the low-vals with appropriately formatted values for named non-FILLER sub fields. Eg. COMP-3, PIC X, PIC 9 DISPLAY, etc.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts How to move DB2 Installation HLQ DB2 4
No new posts How to move values from single dimens... COBOL Programming 1
No new posts Reading the CSV data in COBOL and mov... COBOL Programming 4
Search our Forums:

Back to Top