View previous topic :: View next topic
|
Author |
Message |
ganeshram
New User
Joined: 13 Jun 2008 Posts: 2 Location: chennai
|
|
|
|
How to convert a Packed decimal value to character in CA Easytrieve® Plus? |
|
Back to top |
|
|
chandrarkar
New User
Joined: 27 May 2008 Posts: 24 Location: india
|
|
|
|
I think myself moving a packed to an alphanumeric field.
it shud do fine |
|
Back to top |
|
|
chandrarkar
New User
Joined: 27 May 2008 Posts: 24 Location: india
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
|