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

Move a stringed data to a table filed with justified clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Wed May 30, 2007 9:02 pm
Reply with quote

01 WS-TBL.
05 WS-tbl-AREA OCCURS 20 TIMES INDEXED BY INDEXD.

10 POL-LINE PIC X(81).
10 FILLER REDEFINES POL-LINE.

15 COV-TITLE PIC X(30).
15 FILLER PIC X(01).
15 COV-DIS-COL PIC X(18) JUST RIGHT.
15 COV-DIS-COL-2 PIC X(16) JUST RIGHT.
15 COV-DIS-COL-3 PIC X(16).







Proc div.

IF cond1
IF cond2
STRING BOP-FORMAT-12 DELIMITED BY SIZE
'@ACV' DELIMITED BY SIZE
INTO COV-DIS-COL

end if
endif



Is the above string statement valid??
Can we move a stringed data to a table filed with justified clause.



Thanks,
Vin12pr
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 30, 2007 9:23 pm
Reply with quote

Hello,

The above is not valid - the target field needs to be qualified by the index. You didn't show the first field in the string. . .

You can string data into a field in a table/array. The JUST RIGHT may be lost as string works from left to right - try it on your machine and let us know what happens.

If you post what data you have and what you want done with it, we can offer suggestions on how you might write the code.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed May 30, 2007 9:24 pm
Reply with quote

vin12pr wrote:
Is the above string statement valid?

Did it compile?

vin12pr wrote:
Can we move a stringed data to a table filed with justified clause.


Did you try it. What happened?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed May 30, 2007 9:25 pm
Reply with quote

Refering to the recieving field, the FM does state: It must not represent an edited data item or external floating-point item and must not be described with the JUSTIFIED clause.
I would have assumed that it just ignored the clause, but maybe it does raise a compile error......
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Wed May 30, 2007 9:28 pm
Reply with quote

yeah it did gave me a compile error ..

Any solutions ?
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Wed May 30, 2007 9:31 pm
Reply with quote

yeah dick ..just forgot to mention index in my code,still u will get the compile error

01 WS-TBL.
05 WS-tbl-AREA OCCURS 20 TIMES INDEXED BY INDEXD.

10 POL-LINE PIC X(81).
10 FILLER REDEFINES POL-LINE.

15 COV-TITLE PIC X(30).
15 FILLER PIC X(01).
15 COV-DIS-COL PIC X(18) JUST RIGHT.
15 COV-DIS-COL-2 PIC X(16) JUST RIGHT.
15 COV-DIS-COL-3 PIC X(16).







Proc div.

IF cond1
IF cond2
STRING BOP-FORMAT-12 DELIMITED BY SIZE
'@ACV' DELIMITED BY SIZE
INTO COV-DIS-COL (INDEX D)

end if
endif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 30, 2007 10:19 pm
Reply with quote

Hello,

For this
Quote:
Any solutions ?


Do this
Quote:
If you post what data you have and what you want done with it, we can offer suggestions on how you might write the code.


Show some "input" and how it should be in the result field/array item after the string.
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top