Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sorting of hex values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sorting of hex values
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: 1800
Location: UK

PostPosted: Thu May 25, 2017 4:53 pm    Post subject:
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    Post subject:
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: 8088
Location: East Dubuque, Illinois, USA

PostPosted: Thu May 25, 2017 7:48 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 25, 2017 7:51 pm    Post subject:
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    Post subject:
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: 8088
Location: East Dubuque, Illinois, USA

PostPosted: Thu May 25, 2017 9:59 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1763
Location: Bloomington, IL

PostPosted: Thu May 25, 2017 10:24 pm    Post subject:
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: 2278
Location: @my desk

PostPosted: Thu May 25, 2017 10:58 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us