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
 

 

Converting data - DB2 RBA to Character

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
paulo sampaio viola

New User


Joined: 19 Aug 2009
Posts: 7
Location: lisboa, portugal

PostPosted: Mon Aug 24, 2009 5:44 pm    Post subject: Converting data - DB2 RBA to Character
Reply with quote

Hello!

I am receiving a file with the DB2 LOG. One of the fields is the DB2 RBA (Relative Byte Address). I want to convert this data into character

Example : X'1B785DE110B2' into 1B785DE110B2

I am using the instruction

EXEC SQL
SET :FLOGDB2O-RBA = HEX(:FLOGDB2I-RBA)
END-EXEC.

But I wanted to do this WITHOUT acessing DB2, as the input file can have millions of records.

Can anyone help?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Mon Aug 24, 2009 5:57 pm    Post subject:
Reply with quote

Quote:
I want to convert this data into character

Example : X'1B785DE110B2' into 1B785DE110B2


?? why don't you just remove the "X'" and the last "'"?
Back to top
View user's profile Send private message
paulo sampaio viola

New User


Joined: 19 Aug 2009
Posts: 7
Location: lisboa, portugal

PostPosted: Mon Aug 24, 2009 6:04 pm    Post subject:
Reply with quote

What do you mean?

The field is X(06)

175E1B
B8D102

is the content
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Aug 24, 2009 6:09 pm    Post subject: Reply to: Converting data - DB2 RBA to Character
Reply with quote

Click on the following LINK -

http://www.ibmmainframes.com/viewtopic.php?p=115071&highlight=#115071

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Mon Aug 24, 2009 6:27 pm    Post subject:
Reply with quote

Code:

01  HEX-CHAR-TAB.
    FILLER          PIC X(32) VALUE '000102030405060708090A0B0C0D0E0F'.
    FILLER          PIC X(32) VALUE '101112131415161718191A1B1C1D1E1F'.
    ...
    FILLER          PIC X(32) VALUE 'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'.

01  CONVERT-TAB
    REDEFINES
    HEX-CHAR-TAB.
    05  CONVERT-ITEM           OCCURS 256 TIMES
                               PIC X(02).


01  WS-WORK-AREA.
    05  WS-SUB-1               PIC S9(04) BINARY.
    05  FILLER
        REDEFINES
        WS-SUB-1.
        10  FILLER             PIC X(01) VALUE LOW-VALUES.
        10  PLUG-HEX           PIC X(01).
    05  WS-RBA-WORK.
        10  WS-RBA-1           PIC X(01).
        10  WS-RBA-2           PIC X(01).
        10  WS-RBA-3           PIC X(01).
        10  WS-RBA-4           PIC X(01).
        10  WS-RBA-5           PIC X(01).
        10  WS-RBA-6           PIC X(01).
     05 WS-RBA-CHAR.
        10  WS-RBA-CHAR-1      PIC X(01).
        10  WS-RBA-CHAR-2      PIC X(01).
        10  WS-RBA-CHAR-3      PIC X(01).
        10  WS-RBA-CHAR-4      PIC X(01).
        10  WS-RBA-CHAR-5      PIC X(01).
        10  WS-RBA-CHAR-6      PIC X(01).

MOVE RBA-FROM-INPUT             TO WS-RBA-WORK
MOVE WS-RBA-1                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-1
MOVE WS-RBA-2                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-2
MOVE WS-RBA-3                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-3
MOVE WS-RBA-4                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-4
MOVE WS-RBA-5                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-5
MOVE WS-RBA-6                   TO PLUG-HEX
MOVE CONVERT-ITEM(WS-SUB-1)     TO WS-RBA-CHAR-6

MOVE WS-RBA-CHAR                TO OUTPUT-RBA
Back to top
View user's profile Send private message
paulo sampaio viola

New User


Joined: 19 Aug 2009
Posts: 7
Location: lisboa, portugal

PostPosted: Mon Aug 24, 2009 6:54 pm    Post subject:
Reply with quote

Bill

It really works

Thanks a 1.000.000
icon_biggrin.gif
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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