|
|
| Author |
Message |
iknow
Senior Member
Joined: 22 Aug 2005 Posts: 582 Location: Colarado, US
|
|
|
|
Hi All
How to convert Binary/packed fields to text fields. Please give a detailed explanation. |
|
| Back to top |
|
 |
References
|
|
 |
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 486
|
|
|
|
HI,
| Quote: |
| How to convert Binary/packed fields to text fields. Please give a detailed explanation. |
Please eloborate your problem. What exactly means Text fields and other.
Regards
Rupesh |
|
| Back to top |
|
 |
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 109
|
|
|
|
PLEASE FIND INCLUDE COND=(1,8,CH,EQ,C'TTXSPCLB ')
SORT FIELDS=(10,4,BI,A)
OUTFIL FILES=01,
INCLUDE=((555,4,CH,EQ,C'1234'),OR,(555,4,CH,EQ,C'123 ')),
OUTREC=(1:C'XSPCLBT ', /*FIELD1
9:9,1, /*FIELD2
10:10,4,BI,EDIT=(TTTTTTTTT), /*FIELD2
19:14,55, /*FIELD2
74:69,2,PD,EDIT=(STTT),SIGNS=(+,-,,)) /*FIELD2
THE SORT - CONVERT TO TEXT |
|
| Back to top |
|
 |
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 107 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi vicky,
What do you want to convey?
Regards,
Sridevi. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1526
|
|
|
|
Hi I,
Here's something I did a while ago. The redefines are a bit overdone because I was using the fields for other uses too. If you're using a COMP field move it to WS-WORK-X5.
| Code: |
05 WS-WORK-PACKED PIC 9(009) COMP-3.
05 REDEFINES WS-WORK-PACKED.
10 WS-WORK-X5.
20 WS-WORK-X1 PIC X(001).
20 WS-WORK-X3 PIC X(003).
05 REDEFINES WS-WORK-PACKED.
10 WS-WORK-BIN4 PIC 9(009) COMP.
05 WS-WORK-UNPACKED PIC 9(009).
05 REDEFINES WS-WORK-UNPACKED.
10 WS-WORK-UNPACKED-8 PIC 9(008).
100-CONVERT-HEX-DATA.
*-------------------------------------------------
* CONVERTS HEX DATA FOR DISPLAY PURPOSES
* E.G. X'04FB' => X'F0F4C6C2' OR 04FB CHARACTER
*-------------------------------------------------
MOVE WS-WORK-PACKED TO WS-WORK-UNPACKED
INSPECT WS-WORK-UNPACKED CONVERTING
X'FAFBFCFDFEFF' TO 'ABCDEF'
DISPLAY WS-WORK-UNPACKED-8
.
|
|
|
| Back to top |
|
 |
|
|
|