Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Ajay Baghel

Active User

Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

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

Craq Giegerich

Senior Member

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

Posted: Mon Jun 23, 2008 7:04 pm    Post subject: Re: To findhexadecimal equivalent of 15digitdecimal no thru

 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?
Frank Yaeger

DFSORT Moderator

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

Posted: Mon Jun 23, 2008 8:13 pm    Post subject:

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.
Ajay Baghel

Active User

Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

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

Senior Member

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

Posted: Wed Jun 25, 2008 9:21 pm    Post subject:

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
Ajay Baghel

Active User

Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

Posted: Thu Jun 26, 2008 8:19 pm    Post subject: Reply to: To findhexadecimal equivalent of 15digitdecimal no

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.

Thanks,
Ajay
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

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

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us