View previous topic :: View next topic
|
Author |
Message |
rikdeb
New User
Joined: 19 Jan 2009 Posts: 63 Location: hyderabad
|
|
|
|
Hi all... i was trying to filter out records in as per below requirement:
characters having 'A' to 'O'in 3rd position in one file(say: SORTOF01) and remaining in 2nd file. The sort card below worked fine for me:
Code: |
SORT FIELDS=COPY
OUTFIL INCLUDE=(3,1,AC,GE,X'41',AND,3,1,AC,LE,X'4F'),FILES=01
OUTFIL OMIT=(3,1,AC,GE,X'41',AND,3,1,AC,LE,X'4F'),FILES=02 |
However, i have a doubt here. Mainframes uses EBCEDIC.In sort card i used 3,1,AC,x'41 which compares hexcode in ASCII. hex of A in ascii is 41 and 'O' is 4F. My doubt is how the hex code in ascii is working in EBCEDIC environment. Might be a silly question to ask, but wanted to figure out and get ur advice.
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The key will be to discover what field type AC means. Have you looked in your manual (I know the answer is No, so do so now). |
|
Back to top |
|
|
rikdeb
New User
Joined: 19 Jan 2009 Posts: 63 Location: hyderabad
|
|
|
|
Hi Bill.. I had a look into the manual. That is what was confusing me.
AC stands for ASCII character. But how is dfsort comparing ascii hex codes when z/os uses ebcedic. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, in the example it is not strictly needed, but a useful note to help explain the code.
Data is data, It is all bits. Even ASCII these days has eight bits. If you print your file in hex, it'll look like hex. It is just that the values mean different things in the different conventions.
You could in your example replace AC with CH. However, if not using hex constants... well, you can discover uses for AC.
z/OS has no problem processing ASCII data. The only problem processing ASCII data correctly (a different thing) is to know what is ASCII.
It is generally easier to convert from ASCII to EBCDIC as a file arrives, and the other way as a file departs. However, it is not mandatory. |
|
Back to top |
|
|
rikdeb
New User
Joined: 19 Jan 2009 Posts: 63 Location: hyderabad
|
|
|
|
Thanks Bill..! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
|