IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to edit hexa value in the file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Wed Sep 28, 2011 2:46 pm
Reply with quote

Hi

I have a requirement like below;
In my file first 4 bytes having hexa value. I have checked in the file hexa value i am able to see some nuber. Till the end of records there is some sequence numbers. But i want to edit that seqence number from 1 to till end of file. could you please help me on this.

Thanks
JMR
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Sep 28, 2011 3:10 pm
Reply with quote

open the file in edit mode...

Type 'HEX ON' then edit the numbers.
Back to top
View user's profile Send private message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Wed Sep 28, 2011 3:20 pm
Reply with quote

sorry my file is having lacs of records
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 28, 2011 3:56 pm
Reply with quote

jmreddymca wrote:
sorry my file is having lacs of records


Provide below information:

LRECL RECFM of the input file,

Sort product installed at your shop

Show some sample records.
And expected output ( show hex values for sequence number you want in output)
(Use code tags)
Back to top
View user's profile Send private message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Wed Sep 28, 2011 4:22 pm
Reply with quote

LRECL - 223
RECFM - FB
using DFSORT

Code:
records is like this
å.À%...                          ---- Rec1
4066000
774C009
å.À@...                          ---- Rec2
4067000
774C009  ......

o/p expecting like
å.À%...                          ---- Rec1
0000000
0001009
å.À@...                          ---- Rec2
0000000
0002009  ......

I just wnat to change sequence number from the beginning record.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 28, 2011 4:38 pm
Reply with quote

jmreddymca wrote:
LRECL - 223
RECFM - FB
using DFSORT

Code:
records is like this
å.À%...                          ---- Rec1
4066000
774C009
å.À@...                          ---- Rec2
4067000
774C009  ......

o/p expecting like
å.À%...                          ---- Rec1
0000000
0001009
å.À@...                          ---- Rec2
0000000
0002009  ......
I just wnat to change sequence number from the beginning record.


Sambhaji asked you to use the Code tags. See the difference it makes?

I have no idea what you mean by "hexa", so perhaps you can explain that for us (or me, anyway).

I suspect you don't want to do what you say you want to do. I'm willing to bet a considerable sum (remember, that is all relative, I only bet really, really, tiny amounts) that the existing sequence number is actually a packed-decimal format.

4707646C and 4707647C is the hex "the other way" for your sequence numbers. Notice that the 6 changes to a 7, yet the C stays the same. That would be true for a packed-decimal field (in Cobol, Comp-3 PIC S9(7)). You are suggesting that you would like to change it to a 4-byte binary value starting from 00000001. If you do that without all the other programs that look at the sequence number changing, you will get incorrect results.

I suppose, maybe, your requirement is part of a change to convert the sequence number to a binary number, just on the off-chance that the file might one day accumulate to 2gig of numbers? If so, proceed as is. If not, start your sequence from one in a PD field for the Sort.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Sep 28, 2011 6:40 pm
Reply with quote

Try this code

Code:

  SORT FIELDS=COPY                   
  OUTREC OVERLAY=(1:SEQNUM,4,PD)     
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 28, 2011 10:20 pm
Reply with quote

JMR,

Or if you really want BI sequence numbers, use:

Code:

    OPTION COPY
    OUTREC OVERLAY=(1:SEQNUM,4,BI)
Back to top
View user's profile Send private message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Thu Sep 29, 2011 8:55 am
Reply with quote

Thanks a lot Frank ,Bill,krato below code worked fine
OPTION COPY
OUTREC OVERLAY=(1:SEQNUM,4,BI)

Thanks a lot for your support.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 29, 2011 5:08 pm
Reply with quote

Thanks. Not that helpful of me, I think.

So I loose my bet (Luckily it was my "left pocket" that won the bet, so no overall loss, even though "right pocket" is sad and out for revenge), and still don't know what Hexa is :-) Oh well, I'll wait for next time someone mentions it and ask again.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 29, 2011 9:32 pm
Reply with quote

Hi Bill,

HEXA = Hexadecimal (over and under or side by side). Shows the individual nybbles rather than often unreadable bytes.

Over/under
Code:
å.À%...                         
4066000
774C009

å.À@...                         
4067000
774C009


And as you mentioned:
Quote:
4707646C and 4707647C is the hex "the other way"
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 30, 2011 1:40 am
Reply with quote

Hi Dick,

Thanks. I've never heard it called that, we just called it all "hex" - allowed us more jokes about magic than hexa would have done, I suppose :-)

Learn something new every day.

Have to say, a bit obscure from the usage I've seen on the fora.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Sep 30, 2011 2:13 am
Reply with quote

maybe, it is a non-fluent english speaker's abbreviation of hexadecimal
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top