Hi all,
Could you please anyone tell me, How the comparison done based on collating sequence. I have gone through the Collating sequence, Got some idea and came to know that it is representation of alphabets into machine understandable language. But still confused.
It would be helpful, if you tell me how the comparisons can be done . Since I will be moved to Migration(Mainframe to UNIX) Project in next three months, I am learning my self about all the related things to migration.
I know that the UNIX(data is ASCII format) collating sequence is different and in Mainframe( data is in EBCDIC format) . Each and every alphabet will have different control characters to be understood by Computer.
In EBCDIC:
For Supoose A = 123NASIR
IF A < SPACE or A > 9
then
Display "Print something"
END-IF
why this statement will not work in ASCII environment. I tried lot to understand it, but could not get it. Please help.
I know the ASCII collating sequence is like - NUMBERS,ALPHABETS LOWER,ALPHABETS UPPER,SPACE,SPECIAL CHARACTERS
EBCDIC collating sequence is like - ALPHABETS LOWER,ALPHABETS UPPER,NUMBERS,SPACE,SPECIAL CHARACTERS
How the in mainframe or Unix , the bit by bit comparison will be done. Is it like it internally sort in the order mentioned above for the respective environments(ASCII, EBCDIC) and then it will start comparing??
I am new to Mainframe and Migration. help me to understand the collating sequence to boost my knowledge in Migration .
Thanks,
Nasir
Collating Sequence
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Collating Sequence
What you "know" is WRONG. The SPACE character, for example, is X'20' in ASCII and X'40' in EBCDIC. The space in both collating sequences comes before numbers, before letters (upper AND lower), and there are special characters below and above spaces in both collating sequences.I know the ASCII collating sequence is like - NUMBERS,ALPHABETS LOWER,ALPHABETS UPPER,SPACE,SPECIAL CHARACTERS
EBCDIC collating sequence is like - ALPHABETS LOWER,ALPHABETS UPPER,NUMBERS,SPACE,SPECIAL CHARACTERS
Numbers are X'30' through X'39' in ASCII while they are X'F0' through X'F9' in EBCDIC. Hence if you sort data in ASCII, the numbers will come out before the letters whereas sorting the same data in EBCDIC, the numbers will come out after all the letters. There are 128 characters in ASCII (256 in extended ASCII) and 256 in EBCDIC. Google collating sequence and read up on where different characters come in the collating sequence; be aware, too, that some characters are NOT shared between ASCII and EBCDIC. Also, there are multiple definitions for EBCDIC collating sequence so some characters may appear differently depending upon which definition you are using.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Collating Sequence
Along with what Robert has said, you might also want to read this explanation on Collating Sequence by William Collins:
Also I believe, the example you are showing us is not complete. Why would someone want to compare a variable A which can take value like A = 123NASIR with a single digit 9, which will be just one byte!? (In your example PICture clause of A is not defined, assuming PIC (X) ). I think the example should have been like :
A = 123NASIR
...to make a better sense of the comparison.
Also I believe, the example you are showing us is not complete. Why would someone want to compare a variable A which can take value like A = 123NASIR with a single digit 9, which will be just one byte!? (In your example PICture clause of A is not defined, assuming PIC (X) ). I think the example should have been like :
A = 123NASIR
Code: Select all
IF A(1:1) < SPACE or A > 9
Display "Print something"
END-IF
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- New Member
- Posts: 2
- Joined: Thu Jul 28, 2016 11:20 am
Re: Collating Sequence
Thanks Robert and Anuj.
Yes, Anuj, you were right, the example should be as shown as above. Thank you.
Yes, Anuj, you were right, the example should be as shown as above. Thank you.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Collating Sequence
Hope we had been helpful.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute