Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2504
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us