Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to convert hexadecimal to decimal format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: how to convert hexadecimal to decimal format
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us