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
 
To findhexadecimal value of 15digitdecimal no thru Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Mon Jun 23, 2008 6:59 pm    Post subject: To findhexadecimal value of 15digitdecimal no thru Syncsort
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    Post subject: Re: To findhexadecimal equivalent of 15digitdecimal no thru
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 Moderator


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

PostPosted: Mon Jun 23, 2008 8:13 pm    Post subject:
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: 205
Location: Bangalore

PostPosted: Wed Jun 25, 2008 7:31 pm    Post subject: Reply to: To findhexadecimal equivalent of 15digitdecimal no
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    Post subject:
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: 205
Location: Bangalore

PostPosted: Thu Jun 26, 2008 8:19 pm    Post subject: Reply to: To findhexadecimal equivalent of 15digitdecimal no
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am

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