Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does Cobol Compiler handle Replacing Tags...

Status
Not open for further replies.

Jagbrew

Programmer
Jan 18, 2007
1
0
0
US
Let say a copybook is created as such:

01 :a1:account-number:b1:

and the program does not use a replacing clause on the copy statment...

Does the compiler just ignore the :a1: and :b1: tags and create the field as account-number?
 
I work on IBM Enterprise COBOL. Leaving the replacing phrase off does not work. The string :a1: remains in the copybook and causes a compiler error.

I did try a replacing phrase such as
REPLACING ==:a1:== BY ====
and it removed the string.
 
What size/dataformat would account-number expected to be if :a1: and :b1: where stripped off?

TIA
TonHu
 
And because COBOL processes the tags as Kenny indicated, it's a good idea to make the dash (-) part of the tag as you apparently did.

I've never tried it but I'll bet COBOL doesn't like datanames that begin with a dash. But, even so, it looks ungainly.

Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
 
You're right Jack. COBOL does not like starting a dataname with a hyphen. My copybook had a dataname such as
:a1:-account-number and when I used the REPLACING string as in my last post, I got a compile error for each dataname that looked like that. It became -account-number.
 
Thanx for the update Kenny.

Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top