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: 6968
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: 6968
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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