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 covert a Hexadecimal field to a displayable Zoned format.

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

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Fri Feb 01, 2008 1:16 pm    Post subject: To covert a Hexadecimal field to a displayable Zoned format.
Reply with quote

I have an input file in which a field is in coming to be in Hexadecimal format ( The value is a result of subtraction of two PD fields and are all negative because of which it is coming in hex form ).

Any suggestions regarding how do I convert it the same in SYNCSORT?

Cheers,
Phoenix.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Feb 01, 2008 1:43 pm    Post subject:
Reply with quote

Quote:
I need it to be displayed as a signed numeric. My shop is using Syncsort and the (...HEX,TO=ZD,....) syntax of DFSORT is not working.
Show the SORT card what you tried?
Show what error u received?
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Fri Feb 01, 2008 1:50 pm    Post subject: Reply to: To covert a Hexadecimal field to a displayable Zon
Reply with quote

Hi,

Below is the control card:

Code:
 SORT FIELDS=COPY                             
 OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'   '),       
                OVERLAY=(1:1,75,               
                76:76,9,HEX,TO=ZD,LENGTH=9,   
                85:85,49)),                   
        IFTHEN=(WHEN=NONE,                     
                OVERLAY=(1:1,133))             
 END                                           


And here is the error message:

Code:
SYSIN :                                         
 SORT FIELDS=COPY                               
 OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'   '),         
                OVERLAY=(1:1,75,                 
                76:76,9,HEX,TO=ZD,LENGTH=9,     
                            *                   
                85:85,49)),                     
        IFTHEN=(WHEN=NONE,                       
                OVERLAY=(1:1,133))               
 END                                             
WER268A  OUTREC STATEMENT  : SYNTAX ERROR       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   

Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Feb 01, 2008 6:17 pm    Post subject:
Reply with quote

There is a CONVERT key word. Check the SYNCSORT manuals you should have available to you at your site.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Feb 01, 2008 7:51 pm    Post subject:
Reply with quote

Reaplace HEX with PD


stodolas wrote:
There is a CONVERT key word. Check the SYNCSORT manuals you should have available to you at your site.
CONVERT is for FB to VB conversion.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Feb 01, 2008 8:00 pm    Post subject:
Reply with quote

I just ran a search through the manual and REPLACE is not a keyword for SYNCSORT. But you are correct on the convert function.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Feb 01, 2008 8:12 pm    Post subject:
Reply with quote

stodolas wrote:
I just ran a search through the manual and REPLACE is not a keyword for SYNCSORT. But you are correct on the convert function.

I didnt mean to say use the Keyword "Replace", i told to replace the word HEX to PD
That is Phoenix's SORT card should be changed to
Code:
SORT FIELDS=COPY                             
 OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'   '),       
                OVERLAY=(1:1,75,               
                76:76,9,PD,TO=ZD,LENGTH=9,   
                85:85,49)),                   
        IFTHEN=(WHEN=NONE,                     
                OVERLAY=(1:1,133))             
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Mon Feb 04, 2008 2:31 pm    Post subject: Reply to: To covert a Hexadecimal field to a displayable Zon
Reply with quote

Hello,

I think i didn't explain the problem properly, so here is an example:

My output file is having a field which is having values written as below:

Code:
00000000M
00000000M
00000000Q
00000000Q
00000000J
00000000J
00000000K


these are the HEX values of the numbers -4-,4,-8,-8,-1,-1 and -2
whereas I want it to be as with as many/no preceeding zeros ( the output field is anyway 9 bytes):

Code:

-0004
-0004
-0008
-0008
-0001
-0001
-0002



I already tried what you mean by changing HEX to PD but that didn't help as the field has value in hexadecimal. With PD I get the output as below:

Code:

.0.0.0.0.M
.0.0.0.0.M
.0.0.0.0.Q
.0.0.0.0.Q
.0.0.0.0.J
.0.0.0.0.J
.0.0.0.0.K


Please advice if there exists a solutiion to convert hexadecimal numbers to negative numbers with sign.

Cheers,
Phoenix.
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 Feb 04, 2008 4:49 pm    Post subject: Re: Reply to: To covert a Hexadecimal field to a displayable
Reply with quote

Phoenix wrote:
Hello,

I think i didn't explain the problem properly, so here is an example:

My output file is having a field which is having values written as below:

Code:
00000000M
00000000M
00000000Q
00000000Q
00000000J
00000000J
00000000K



Those are signed packed decimal numbers.
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 Feb 04, 2008 6:07 pm    Post subject:
Reply with quote

Correction on that I should have said SIGNED ZONED DECIMAL.
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Tue Feb 05, 2008 1:19 pm    Post subject: Reply to: To covert a Hexadecimal field to a displayable Zon
Reply with quote

Hi Craq,

Here in the output file they were written as characters via a QUIKJOB in which I have two PD numbers say A and B ( both S9(9) comp-3) .

Now there are two fields in the report say QTY-1 and QTY-2 (both also S9(9) comp-3) that come from addition and subtraction of these numbers.

So
QTY-1 = A + B which will always be positive as both A and B are always positive, and

QTY-2 = A - B which may be negative depending on the values of A and B, and in all the cases for my requirement B > A so QTY-2 is always -ve.

Now when QTY-1 and QTY-2 are being moved to character fields X(9) in the output, QTY-1 which is positive is displaying correctly as say for e.g. = 000000045,

but QTY-2 being negative is being displayed in hex format.

So yes these are PD numbers being moved to equivalent character fields in the output file.

Code:

00000000M
00000000M
00000000Q
00000000Q
00000000J
00000000J
00000000K


I hope i am clear.

Cheers,
Phoenix
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Feb 05, 2008 3:16 pm    Post subject:
Reply with quote

Your i/p sis not hexadecimal its Zone Decimal fomat(ZD)
Code:
//***************************************************
//STEP1    EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
00000000M                                           
00000000M                                           
00000000Q                                           
00000000Q                                           
00000000J                                           
00000000J                                           
00000000K                                           
/*                                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  INREC FIELDS=(1,9,ZD,EDIT=(STTTT),SIGNS=(+,-),80:X)
           SORT FIELDS=COPY                         
/*                                                   
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Tue Feb 05, 2008 3:50 pm    Post subject:
Reply with quote

If you ask for the right thing it is much easier to get the correct answer.
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Tue Feb 05, 2008 3:54 pm    Post subject: Reply to: To covert a Hexadecimal field to a displayable Zon
Reply with quote

Thanks Kris. It worked this time.

thanks a lot.

Cheers,
Phoenix.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

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