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

Regarding Lower case in Cobol.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Nov 17, 2009 7:25 pm
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: 6966
Location: porcelain throne

PostPosted: Tue Nov 17, 2009 7:28 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 17, 2009 7:42 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 17, 2009 7:42 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Nov 17, 2009 7:48 pm
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
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: 6966
Location: porcelain throne

PostPosted: Tue Nov 17, 2009 8:00 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Nov 17, 2009 8:16 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 17, 2009 8:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top