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

Continuation Problem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Thu Jul 01, 2010 1:32 pm
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
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: 20
Location: Oklahoma City, OK USA

PostPosted: Fri Jul 09, 2010 7:07 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top