Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
conversion of Binary/packed fields to text fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
iknow

Senior Member


Joined: 22 Aug 2005
Posts: 582
Location: Colarado, US

PostPosted: Thu Oct 13, 2005 12:38 pm    Post subject: conversion of Binary/packed fields to text fields
Reply with quote

Hi All
How to convert Binary/packed fields to text fields. Please give a detailed explanation.
Back to top
View user's profile Send private message
References
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 486

PostPosted: Thu Oct 13, 2005 12:56 pm    Post subject: Re: conversion of Binary/packed fields to text fields
Reply with quote

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
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 109

PostPosted: Thu Oct 13, 2005 6:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 107
Location: Concord, New Hampshire, USA.

PostPosted: Thu Oct 13, 2005 6:24 pm    Post subject:
Reply with quote

Hi vicky,
What do you want to convey?
Regards,
Sridevi.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Fri Oct 14, 2005 6:21 am    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1