Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Continuation Problem

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

New User


Joined: 06 Jan 2008
Posts: 11
Location: India

PostPosted: Thu Jul 01, 2010 12:59 pm    Post subject: Continuation Problem
Reply with quote

Hi I have a copy book like below:

Code:
05 MSR1-AGE25                        PIC X(60) VALUE           
'125461258612625126641270412744127841282412865129051294612987'.
05 MSR1-AGE26                        PIC X(60) VALUE           
'130281306913109131501319113233132741331613358134001344213485'

Since i was not able 2 give the whole value in a single line, i thought to use continuation character and i gave as below:

Code:
   05 MSR1-AGE24                        PIC X(60) VALUE             
       '1208112119121571219512233122721231112350123891242812467125 
 -         '07'.                                                     


i.e., continuation char is Pos7 and '07' = > in Pos17

But im getting below errors:
"VALUE" literal "'1208112119121571219512233122721231112350123891242812467
125 07'" exceeded the length specified in the "PICTURE" definition. The
literal was truncated to the "PICTURE" definition length.
I can split this but i have nearly 1700 entries so i thought it wud b better to use a continuation character.

Please let me know whether i should give any other details.
can anybody help me solve this??
Thanks in advance.
Deepa
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Jul 01, 2010 1:32 pm    Post subject:
Reply with quote

Code:
000011111111112222222222333333333344444444445555555555666666666677777777778
678901234567890123456789012345678901234567890123456789012345678901234567890
   05 MSR1-AGE24                        PIC X(60) VALUE             
       '1208112119121571219512233122721231112350123891242812467125 
 -         '07'.                                                     

If the continued line contains an alphanumeric or national literal without a closing quotation mark, all spaces at the end of the continued line (through column 72) are considered to be part of the literal.
Back to top
View user's profile Send private message
icemanroh

New User


Joined: 23 Aug 2008
Posts: 25
Location: Mumbai

PostPosted: Thu Jul 08, 2010 6:55 pm    Post subject:
Reply with quote

Try below. Remove all the spaces after -

Code:
05 MSR1-AGE24                        PIC X(60) VALUE             
     '1208112119121571219512233122721231112350123891242812467125
 -'07'.
Back to top
View user's profile Send private message
CaptBill

New User


Joined: 28 May 2009
Posts: 16
Location: Oklahoma City, OK USA

PostPosted: Fri Jul 09, 2010 7:07 am    Post subject:
Reply with quote

Using continuation on a line of any code is a bad idea. I suggest you define the data this way:
Code:

05  MSR1-AGE24.
    10  FILLER    PIC   X(30)  VALUE
        '123456789012345678901234567890'.
    10  FILLER    PIC   X(30)  VALUE
        '123456789012345678901234567890'.


You get the same results and much easier for the person that follows you to maintain.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jul 09, 2010 12:06 pm    Post subject:
Reply with quote

CaptBill wrote:
Using continuation on a line of any code is a bad idea.


excellent!
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Fri Jul 09, 2010 2:32 pm    Post subject:
Reply with quote

CaptBill wrote:
Using continuation on a line of any code is a bad idea. I suggest you define the data this way:
Code:

05  MSR1-AGE24.
    10  FILLER    PIC   X(30)  VALUE
        '123456789012345678901234567890'.
    10  FILLER    PIC   X(30)  VALUE
        '123456789012345678901234567890'.


You get the same results and much easier for the person that follows you to maintain.


I agree fully on CaptBill's suggestion that it is a better way of splitting literal value definitions.

But I would anyway suggest that you use an external file for holding the initialisation values to be read and populated into your defined data area, since you mention 1700 data items to be initialised.

That way it should be easier to maintain the initialisation values, especially if the 1700*60 bytes are generated by some algorithm, as I suspect they must be. This also eliminate the need for regenerating the loadmodule if some of the initialisation values will have to be changed.
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
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us