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

Data move error S0c7


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

New User


Joined: 14 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Sun Nov 30, 2008 1:58 am
Reply with quote

I have a file which is basically coma delimited file.

I want to extract the fileds of it.

One of the field is some units, in the file the value is 7.323
I read it in the program as S9(3)V9(6).
The output field as defined as S9(3)V9(6).
But i am getting S0c7 while moving them.

Please help
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: Sun Nov 30, 2008 3:14 am
Reply with quote

Are you saying that the decimal-point is implied or is actually present in the CSV file?

If it is actually present (a/k/a an edit-pattern field), then you need place this value into an edited-field (999.999999) then move this edit-pattern field into a field defined as S9(03)V9(06). This is sometimes known as "de-editing".

I'm also assuming that the data-length is always 09-bytes.

Will the decimal-data always be positive? If so, then there's no need to define the field as signed display-numeric.

Bill
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: Sun Nov 30, 2008 4:59 am
Reply with quote

Hello,

Quote:
I'm also assuming that the data-length is always 09-bytes.
If the units value might contain less than 10 positions (999.999999) or 11 if there is a possible negative value, you might consider doing the UNSTRING into a pic x field and then using NUMVAL to move the units value to the 999v(9) field. The sample value posted is only 5 positions in length.

As Bill mentioned, if the value cannot ever be negative, there is no need to make the target field signed.
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: Sun Nov 30, 2008 6:28 am
Reply with quote

Quote:

I'm also assuming that the data-length is always 09-bytes.

Dick,

I do my best counting after Thanksgiving. Altryptophan overdose ya know icon_wink.gif

Bill
Back to top
View user's profile Send private message
sriram_motamarri
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Sun Nov 30, 2008 8:06 am
Reply with quote

Hi Bill,

Yes the decimal point is implied in the CSV file.
Please tell me how i need to read it and move.
Let say the value is 7.233
The field i want in the output file is +007233000
i.e.,S9(3)V9(6)

Thanks,
Sriram
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: Sun Nov 30, 2008 8:38 am
Reply with quote

Hello,

As i mentioned previously, define the receiving field from the unstring as pic x(10) or x(11) depending on whether there might be a negative value and then use the NUMVAL function.

NUMVAL is fully documented in the cobol language reference available vie the "IBM Manuals" link at the top of the page.

You will find that you receive faster "help" if you follow suggestions when they are initially posted. . . icon_smile.gif
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 Store the data for fixed length COBOL Programming 1
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top