|
View previous topic :: View next topic
|
| Author |
Message |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| 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 |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1216 Location: Dublin, Ireland
|
|
|
|
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 |
|
 |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
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
to be as 21012005. How can i convert this |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
| Code: |
53721861
FFFFFFFF
53721861
|
its not a date.  |
|
| Back to top |
|
 |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
| Man!! Y tags are not working with me. |
|
| Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| Code tags, not img tags. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Saurabh_mi,
For the field shown in your last post - replace this part in your card.
with
| Code: |
| C'!',162,4,HEX,C'!' |
|
|
| Back to top |
|
 |
Saurabh_mi
New User
Joined: 25 May 2017 Posts: 6 Location: New Delhi
|
|
|
|
Ohh..Arun thank you so much.
It's working. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|