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

To findhexadecimal value of 15digitdecimal no thru Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Mon Jun 23, 2008 6:59 pm
Reply with quote

Hi,

My requirement is to convert a 15digit decimal number into its equivalent hexadecimal no.

Is it possible to find hexadecimal equivalent of 15digit number through sort?


Thanks,
Ajay
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 23, 2008 7:04 pm
Reply with quote

Ajay Baghel wrote:
Hi,

My requirement is to convert a 15digit decimal number into its equivalent hexadecimal no.

Is it possible to find hexadecimal equivalent of 15digit number through sort?


Thanks,
Ajay


What format are these 15digit numbers in, Zoned Decimal, Packed Decimal or Binary?
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: Mon Jun 23, 2008 8:13 pm
Reply with quote

Ajay,

It depends on what you mean by "hexadecimal equivalent". Hex is just a way of representing binary values. If you want to display a 15-byte field in hex, you can use:

Code:

    OPTION COPY
    INREC BUILD=(p,15,HEX)


where p is the starting position of the input field.

If you want to do something else, you need to state more clearly what you want to do with examples of input and expected output. Also, give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Wed Jun 25, 2008 7:31 pm
Reply with quote

Hi Frank,

I have an input FB file (lrecl=15) containing 15 digit decimal no in each record.

eg:
123456789012345
223456789012345
281234567890123

I want an output file (20 bytes lrecl FB) that contains corresponding values in Hexadecimal (16 Digits).
00007048860DDF79
0000CB3B96881F79
0000FFC8068484CB

123456789012345 's hexadecimal eqivalent is 00007048860DDF79.

I know it can be done through an in-built function in rexx, but I am wondering if same can be done thru dfsort also.

Thanks,
Ajay
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jun 25, 2008 9:21 pm
Reply with quote

Ajay Baghel,

The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN         
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD *                     
123456789012345                     
223456789012345                     
281234567890123                     
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                     
  SORT FIELDS=COPY                 
  INREC BUILD=(1,15,ZD,BI)         
  OUTREC BUILD=(01,8,HEX,4X)       
//*                                 


The output from this job is
Code:

00007048860DDF79
0000CB3B96881F79
0000FFC8068484CB
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Thu Jun 26, 2008 8:19 pm
Reply with quote

Hi Skolusu,

I am getting the error message:

WER215A OUTREC ARITHMETIC OVERFLOW


When I submit the below job:

Code:
//xxx pgm=sort
//sysprint dd sysout=*
//sysout  dd sysout=*
//sortin    dd *
200807913398189      1
/*
//sortout    dd  dsn=test.out.binary,
//     disp=(,catlg),lrecl=15,recfm=fb,space=(trk,(1,2),rlse)
//sysin   dd *
 option copy
 outrec fields=(1,15,zd,bi,15:x)
/*


From WER messages, i know that SYNCSORT is getting invoked here.
Alissa, can you please help?


Thanks,
Ajay
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top