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

how to convert hexadecimal to decimal format


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shanmugapriya j

New User


Joined: 28 Dec 2006
Posts: 9
Location: chennai

PostPosted: Fri Mar 19, 2010 12:17 pm
Reply with quote

Hi I want to convert the x(18) to s(13) v 9(4) comp-3.
For e.g ; below is the input file
5085|100013|9770|baseint|2010-03-03 06.02.51|0|0|0|14900.0|N|

which has to convert to EBCDIC format to load in to table.

I want to convert 14900.0 to s(13) v 9(4) comp-3 format.
Can any one help in this please.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Mar 19, 2010 2:01 pm
Reply with quote

This looks | delimited file.
What is LRECL and RECFM of file?
You need to give datatype of each field and maximum possible lengths.

How should be output? should it be | delimited again? what should be LRECL\RECFM of output file?
Back to top
View user's profile Send private message
shanmugapriya j

New User


Joined: 28 Dec 2006
Posts: 9
Location: chennai

PostPosted: Fri Mar 19, 2010 2:08 pm
Reply with quote

Rec length is 350 and RECFM FB . output will be RECL of 78
Using program to unstring the "|" then moving alll the variables from x ( ) to 9( ) . after that moving the 9( ) to s9() comp or something else.

all the variables are moving properly except the Digits variable.
Back to top
View user's profile Send private message
shanmugapriya j

New User


Joined: 28 Dec 2006
Posts: 9
Location: chennai

PostPosted: Fri Mar 19, 2010 2:53 pm
Reply with quote

Got the answer, we have to compute the variable

Where
05 WS-COST-AMT PIC X(18).
05 WS-COST-AMT1 PIC S9(13)V9(4).
05 WS-OCOST-AMT PIC S9(13)V9(04) COMP-3.

After delimiting the "|"

COMPUTE WS-COST-AMT1 = FUNCTION NUMVAL(WS-COST-AMT)
MOVE WS-COST-AMT1 TO WS-OCOST-AMT
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top