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

How to convert packed decimal to character in CA EasytrieveÂ


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ganeshram

New User


Joined: 13 Jun 2008
Posts: 2
Location: chennai

PostPosted: Wed Jun 18, 2008 8:05 pm
Reply with quote

How to convert a Packed decimal value to character in CA Easytrieve® Plus?
Back to top
View user's profile Send private message
chandrarkar

New User


Joined: 27 May 2008
Posts: 24
Location: india

PostPosted: Wed Jun 18, 2008 9:18 pm
Reply with quote

I think myself moving a packed to an alphanumeric field.
it shud do fine
Back to top
View user's profile Send private message
chandrarkar

New User


Joined: 27 May 2008
Posts: 24
Location: india

PostPosted: Tue Aug 26, 2008 3:45 pm
Reply with quote

hi i got this info from other sources

This section describes how to convert the previously discussed packed-decimal formats into text strings to print or display the information in a human readable form. Before converting the packed-decimal fields it should be determined if a conversion is necessary. The following list provides some basic guidelines.

1. When migrating an application (both data and COBOL programs for processing the data) from an IBM Mainframe to a Micro Focus and Windows environment a conversion is not necessary. Micro Focus COBOL supports the packed-decimal format.
2. When migrating an application (both data and COBOL programs for processing the data) from an IBM Mainframe to a Micro Focus and UNIX environment a conversion is not necessary. Micro Focus COBOL supports the packed-decimal format.
3. When migrating or transferring data from a COBOL oriented, IBM Mainframe or AS/400 environment to a non-COBOL oriented (Windows or UNIX) environment (i.e. ASCII/Text or excel spreadsheet) then a conversion will be required. This may require two conversion tasks. The packed-decimal fields (or data strings) will need to be converted to a zoned-decimal format (sign leading separate with an explicit decimal point should be considered depending on the target environment). The zoned-decimal format may then require a conversion from EBCDIC to ASCII.
4. When using the File Transfer Protocol (FTP) to transfer a data file between a mainframe and a Windows or UNIX environment it will be necessary to use the BINARY mode if the records contain packed-decimal fields. If a conversion between EBCDIC and ASCII is required it will need to be done after the transfer.

thanks
teja
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: Tue Aug 26, 2008 8:55 pm
Reply with quote

Hello,

How does this relate to the Easytrieve question?

Quote:
How to convert a Packed decimal value to character
Please post a couple of examples of packed values you have and how you want the after they are converted. As was mentioned, a simple move may be all that you need.
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Aug 28, 2008 11:23 am
Reply with quote

Hi,
I think as the other ppl said you can simply move it and it should work.
for eg-: ws-no 5 P 2 to can be moved to ws-ch 7 A.
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: Thu Aug 28, 2008 8:58 pm
Reply with quote

Hello,

Quote:
I think myself moving a packed to an alphanumeric field.

Quote:
I think as the other ppl said you can simply move it and it should work.
Did you test these? What was the result?

This code:
Code:
DEFINE PKDFLD W 5 P 2 VALUE 123 
DEFINE DSCHCLD1 W 8 A           
MOVE PKDFLD TO DSCHCLD1     
DISPLAY PKDFLD             
DISPLAY DSCHCLD1           

gives this result:
Code:
      123.00   
444444FFF4FF4444
000000123B000000
________________
               
0013044444444444
0020C00000000000
________________


I suspect that is not what was desired. . .
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Aug 29, 2008 12:51 am
Reply with quote

The "move" command does not convert types. Use the assignment statement instead. Assign a numeric variable to the packed variable then assign the character variable to the numeric. Note for the numeric variable if the number of decimal places is zero still do not leave this off.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top