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
 
Move a stringed data to a table filed with justified clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Move a stringed data to a table filed with justified clause
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

Site Director


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

PostPosted: Wed May 30, 2007 9:23 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Wed May 30, 2007 9:24 pm    Post subject: Re: string statement doubts
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: 3158
Location: Tucson AZ

PostPosted: Wed May 30, 2007 9:25 pm    Post subject:
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    Post subject: Re: string statement doubts
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    Post subject: Re: string statement doubts
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

Site Director


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

PostPosted: Wed May 30, 2007 10:19 pm    Post subject:
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    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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

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