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

Sorting of hex values


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

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Thu May 25, 2017 3:49 pm
Reply with quote

Hi!
I have one vsam file as input in which dates are in hex values so while sorting index field I'm using these date
Now I want data should be come in alphanumeric, flat file.
I have already use
(1,8,bi,zdf) didn't worked file have spaces
(1,8,hex)

Please suggest
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2449
Location: Hampshire, UK

PostPosted: Thu May 25, 2017 4:53 pm
Reply with quote

Not a JCL/VSAM topic but a sort topic - moved to DFsort (if you use Syncsort then let us know and it will be moved there).

All data is in hex so please state which format your values are in: zoned decimal, packed or binary. And show examples of what they are and what you want. and use the code tags to present the data.
Back to top
View user's profile Send private message
Saurabh_mi

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Thu May 25, 2017 6:44 pm
Reply with quote

Hi, its zoned decimal.

so below is code which i'm using.

Code:
SORT FIELDS=COPY                                               
INCLUDE COND=(27,4,BI,GE,X'20000101',AND, * EXPIRY DATE       
              27,4,BI,LE,X'20170520')                         
OUTREC FIELDS=(1,8,,C'!',9,2,C'!',20,1,C'!',47,6,C'!')

And i'm getting 40404040 as output in Falt file.


code' d
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Thu May 25, 2017 7:48 pm
Reply with quote

I think you are EXTREMELY confused. "zoned decimal" data would be X'F2F0F0F0F0F1F0F1' and X'F2F0F1F7F0F5F2F0' for your dates. You are treating them as full word binary values in your INCLUDE statement. Furthermore, you do NOT specify where you are getting spaces in your output -- if you think the date values should be there, then you need to include those bytes in your OUTREC FIELDS statement. Since you did not specify what you want from bytes 21 to 46 (which includes your date field), what did you think you would get there?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1099
Location: Dublin, Ireland

PostPosted: Thu May 25, 2017 7:51 pm
Reply with quote

You didn't use code tags, as requested - see the buttons above ehere you're keying.

Also, you haven't shown an example of the data, just some attempt at control cards - (with an embedded comment?).

Garry.
Back to top
View user's profile Send private message
Saurabh_mi

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Thu May 25, 2017 9:50 pm
Reply with quote

Hi Robert, thankyou so much for giving me idea.
So now i'm getting values in my output file.

Code:
OUTREC FIELDS=(1,8,C'!',9,2,C'!',20,1,C'!',47,6,C'!',   
            122,4,C'!',162,4,C'!',182,4,C'!',           
            199,5,C'!',428,6,C'!')                   


output file
Code:

50000126!04!C!004500!LS10!    !    !     !000006!
FFFFFFFF5FF5C5FFFFFF5DEFF52020500005000005FFFFFF5
50000126A04A3A004500A3210A1105A0000A0000FA000006A


So I need

Code:
2020
1105



to be as 21012005. How can i convert this
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Thu May 25, 2017 9:59 pm
Reply with quote

Try
Code:
OUTREC FIELDS=(1,8,C'!',9,2,C'!',20,1,C'!',27,4,BI,TO=ZD,LENGTH=8,47,6,C'!',
 122,4,C'!',162,4,C'!',182,4,C'!',
 199,5,C'!',428,6,C'!')
Back to top
View user's profile Send private message
Saurabh_mi

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Thu May 25, 2017 10:02 pm
Reply with quote

Code:
53721861
FFFFFFFF
53721861


its not a date. icon_sad.gif
Back to top
View user's profile Send private message
Saurabh_mi

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Thu May 25, 2017 10:03 pm
Reply with quote

Man!! Y tags are not working with me.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu May 25, 2017 10:24 pm
Reply with quote

Code tags, not img tags.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu May 25, 2017 10:58 pm
Reply with quote

Saurabh_mi,

For the field shown in your last post - replace this part in your card.
Code:
C'!',162,4,C'!'

with
Code:
C'!',162,4,HEX,C'!'
Back to top
View user's profile Send private message
Saurabh_mi

New User


Joined: 25 May 2017
Posts: 6
Location: New Delhi

PostPosted: Fri May 26, 2017 11:36 am
Reply with quote

Ohh..Arun thank you so much.

It's working.
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 Creating additional seqnum/Literal wh... DFSORT/ICETOOL 4
No new posts a copybook getting improper values in... COBOL Programming 7
No new posts JDBC Driver -Default Values DB2 1
No new posts Not able to view the values of variab... CA Products 1
No new posts ICETOOL Sorting and Discarding DUPS SYNCSORT 11
Search our Forums:

Back to Top