Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Regarding Lower case in Cobol.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Nov 17, 2009 7:22 pm    Post subject: Regarding Lower case in Cobol.
Reply with quote

I want to write " Hello" as such in the output file. That is H has to be in capital and rest in small.
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: Tue Nov 17, 2009 7:25 pm    Post subject:
Reply with quote

What happened when you tried it ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Nov 17, 2009 7:28 pm    Post subject:
Reply with quote

Quote:
Is it possible through Cobol ?


yes.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Nov 17, 2009 7:36 pm    Post subject:
Reply with quote

dbzTHEdinosauer

can you please tell how? ..

expat

I tried.. all output was in caps HELLO.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Nov 17, 2009 7:42 pm    Post subject: Reply to: Regarding [b]Lower case [/b]in Cobol.
Reply with quote

post the code You used!
what happens when You run something along ...

Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
ENVIRONMENT DIVISION.       
DATA DIVISION.
PROCEDURE DIVISION.
    DISPLAY 'Hello, world.'.
    STOP RUN.


I do not speak COBOLESE ...
make the appropriate corrections in order to have the snippet compile properly
and see what happens when You run it!

watch out for the caps settings in Your ISPF edit session!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 17, 2009 7:42 pm    Post subject: Reply to: Regarding [b]Lower case [/b]in Cobol.
Reply with quote

What version/release of COBOL are you running?

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8152
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 7:48 pm    Post subject:
Reply with quote

Code:
       01  WS-VARIABLES.
           05  WS-RECORD               PIC X(80) VALUE
               'Hello'.

       01  OUT-FILE-FS                 PIC 9(02) VALUE 00.

      /
       PROCEDURE DIVISION.
       S1000-MAIN       SECTION.
           OPEN OUTPUT OUT-FILE.
           DISPLAY 'OPEN OUT-FILE FS = ' OUT-FILE-FS.
           WRITE OUT-FILE-REC FROM WS-RECORD.
           DISPLAY 'WRITE FILE STATUS = ' OUT-FILE-FS.
           CLOSE OUT-FILE.
           DISPLAY 'CLOSE FILE STATUS = ' OUT-FILE-FS.
           STOP RUN.
produces a file with
Code:
********************************* Top of Data **********************************
Hello
******************************** Bottom of Data ********************************
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Nov 17, 2009 7:53 pm    Post subject:
Reply with quote

Robert Sample

i tried the same .. could it cobol version problem ? or do i need to check any settings ?
I am not sure about my cobol version .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Nov 17, 2009 8:00 pm    Post subject:
Reply with quote

if your ISPF Profile is set to CAPS ON, you will only have upper case characters in you source file.

what does your source file look like with respect to however you have coded the characters 'Hello World'.

Quote:
I am not sure about my cobol version


Sigh....the version can be ascertained by looking at your compile output listing.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Nov 17, 2009 8:12 pm    Post subject:
Reply with quote

Will ISPF profile have any significance , whenwe run through CA7 sheduler ? am not running through my local .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8152
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 17, 2009 8:16 pm    Post subject:
Reply with quote

There is no impediment in COBOL to writing lower case data, as my example shows. If you're having a problem, it is either because your source data is not lower case, or you are forcing upper case somehow.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 17, 2009 8:16 pm    Post subject:
Reply with quote

cvishu wrote:

I am not sure about my cobol version .


If you review your compile listing, at the top of each page, it will indicate your COBOL version/release, such as (example only) -

Code:

IBM COBOL for OS/390 & VM  2.2.1

Is this homework?

Bill
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
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us