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

What does this variable declaration mean?


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

New User


Joined: 19 Dec 2005
Posts: 14

PostPosted: Fri May 25, 2007 2:31 pm
Reply with quote

I saw a declaration in a copybook as below.

:FMVQ:-ERROR-MSG
PIC X(01)BX(03)BX(56).

What data type is this exactly, how many bytes will it take?
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Fri May 25, 2007 2:57 pm
Reply with quote

In the copybook it is declared as :FMVQ: -

In the program it can be replaced.If repalcing is used, it will be like(for example 2 files are of same layout and use the same copy book in a program,then it will be declared as )

Code:
file1
COPY <copybook name> REPLACING ==:FMVQ:== BY ==PREV==.

file2
COPY <copybook name> REPLACING ==:FMVQ:== BY ==NEXT==.


Quote:
:FMVQ:-ERROR-MSG PIC X(01)BX(03)BX(56).


In program, file 1 will be used as PREV-ERROR-MSG and file 2 will be used as NEXT-ERROR-MSG

If the option of replace is not specified ,it will be taken as FMVQ.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 25, 2007 4:08 pm
Reply with quote

Mayil wrote:
:FMVQ:-ERROR-MSG PIC X(01)BX(03)BX(56).
What data type is this exactly, how many bytes will it take?

It is a 62 byte alphanumeric recieving field for a 60 byte sending field.
It forces blank or space between the first and second character and the fourth and fifth character.
Back to top
View user's profile Send private message
Mayil

New User


Joined: 19 Dec 2005
Posts: 14

PostPosted: Fri May 25, 2007 5:17 pm
Reply with quote

Thanks a lot William for the explantion. I was actually displaying the length of the variable and it displayed it as 62, was really confused. Your explanation clears my doubts.

Muthuvel, thanks for the effort. Actually i was confused regarding the data type only.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top