MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

for a change !

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vinush2000
Beginner


Joined: 17 Jun 2005
Posts: 15
Topics: 5

PostPosted: Thu Nov 03, 2005 9:04 am    Post subject: for a change ! Reply with quote

I am posting a question with the answer; wonder how many have ever done this in this forum.

I found this intresting enough to share with the forum, Surprised

How do you print a string 'Hai' (including the quote) in a file using COBOL. the answer is to use

05 FILLER X(01) VALUE ''''.

this prints a single quote.

so, for 'Hai'

05 FILLER X(01) VALUE ''''.
05 FILLER X(03) VALUE 'HAI'.
05 FILLER X(01) VALUE ''''.
Back to top
View user's profile Send private message
vinush2000
Beginner


Joined: 17 Jun 2005
Posts: 15
Topics: 5

PostPosted: Thu Nov 03, 2005 9:07 am    Post subject: Reply with quote

Hi all,

I wish everyone can post some intresting 'Find' with solution.

regards,
vinu
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Nov 03, 2005 9:21 am    Post subject: Reply with quote

vinush,

Is this a trick question? Isn't it this simple?

Code:

01 WS-FILLER            PIC X(05) VALUE "'HAI'".


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vinush2000
Beginner


Joined: 17 Jun 2005
Posts: 15
Topics: 5

PostPosted: Thu Nov 03, 2005 9:24 am    Post subject: my compiler didn't accept that Reply with quote

hi,

my compiler didn't accept that. does yours' accept?

regards,
vinu
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Nov 03, 2005 9:28 am    Post subject: Reply with quote

vinush2000,

I don't have any problem with the syntax. what is your compiler? VS COBOL- II?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Thu Nov 03, 2005 9:44 am    Post subject: Reply with quote

I believe that it is dependant on the APOST compile option. Our shop uses single quotes to delimit values. In this case, you can substitute VALUE QUOTE for VALUE ''''.
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Nov 03, 2005 9:53 am    Post subject: Reply with quote

Kolusu,

I also tried out and it is as easy as


Code:

01 HAI PIC X(5) VALUE "'HAI'".



In u post u mentioned that vinush2000 's compiler might be VS COBOL II.
In my case when i see compiler listing ,i see at the top of compile listing

Code:

IBM COBOL for OS/390 & VM  2.1.1



If visnush compiler is VS COBOL II ,then i guess the compile listing would be below.Please correct me and i have a query which might be silly too.I have the knowledge that we have three types of COBOL VS COBOL II,IBM COBOL and ENTERPRISE COBOL,can u please tell me which one is the latest one and widely used and is there any link which mentions about the differences in the types of COBOLS we have in present ?

Code:

VS COBOL- II


_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Thu Nov 03, 2005 10:01 am    Post subject: Reply with quote

Quote:

can u please tell me which one is the latest one and widely used and is there any link which mentions about the differences in the types of COBOLS we have in present ?



shekhar123,

Check this link .

http://www.mvsforums.com/helpboards/viewtopic.php?p=21152#21152

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group