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

Regading ascii and ebcedic in sort.


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

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Wed Mar 05, 2014 4:51 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Mar 05, 2014 5:09 pm
Reply with quote

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
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Wed Mar 05, 2014 5:26 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Mar 05, 2014 5:53 pm
Reply with quote

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
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Wed Mar 05, 2014 5:58 pm
Reply with quote

Thanks Bill..!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Mar 06, 2014 8:04 am
Reply with quote

As Bill said in detail, the below link would also support to wat you asked for,

www-01.ibm.com/support/docview.wss?uid=isg3T7000242
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top