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
 

 

Sign representation using sync sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Feb 25, 2009 5:18 pm    Post subject: Sign representation using sync sort
Reply with quote

Hi,

I am sorting a file based on two key fields and also removing the duplicates.

Code:
SORT FIELDS=(1,4,ZD,A,67,9,ZD,A)
SUM FIELDS=NONE
OUTREC BUILD=(1,4,X'6B',6:67,9).

The output file should contains the key fields sorted and seperated by comma.

The result of sort was
Code:
0006,00000008{
0007,00000011{
0009,00000012{ 


The cobol equivalent datatype for the key fields in the input file is

key field1 -- PIC 9(4)
key field2 -- PIC S9(9)

I guess '{' represents the sign bit. Is there any possible way of representing it with '+' or '-' sign.

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Wed Feb 25, 2009 6:25 pm    Post subject:
Reply with quote

murugan_mf,

Change your OUTREC statement as below.
Code:
OUTREC BUILD=(1,4,X'6B',67,9,ZD,EDIT=(STTTTTTTTT),SIGNS=(+,-,,))
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Feb 25, 2009 7:17 pm    Post subject: Re: Sign representation using sync sort
Reply with quote

Hi,
murugan_mf wrote:
I guess '{' represents the sign bit. Is there any possible way of representing it with '+' or '-' sign.
Yes that's true:
Code:
0 = {          -0 = }                                         

e.g:
Code:
NUMBER    REPRESENTATION 

10        00000001{
105       00000010E
0         00000000{
-234      00000023M
-30       00000003}   
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Feb 25, 2009 7:19 pm    Post subject:
Reply with quote

Arun,

I changed the OUTREC statement as you said its working fine.

I need a clarification

Code:
 EDIT=(STTTTTTTTT),SIGNS=(+,-,,)


+ & - are the signs and again you have used a comma in SIGNS=(+,-,,).

I executed by giving SIGNS=(+,-). It works fine.

What is the difference in adding an extra comma.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Thu Feb 26, 2009 1:56 pm    Post subject: Reply to: Sign representation using sync sort
Reply with quote

Murugan,


The following is a table identifying the zoned decimal hex characters.

Code:
   Last       -----Character (Hex Code)----- 
   Digit     Unsigned     Positive    Negative 
   -----     --------       --------    -------- 
     0       "0" (F0)     "{" (C0)    "}" (D0) 
     1       "1" (F1)     "A" (C1)    "J" (D1) 
     2       "2" (F2)     "B" (C2)    "K" (D2) 
     3       "3" (F3)     "C" (C3)    "L" (D3) 
     4       "4" (F4)     "D" (C4)    "M" (D4) 
     5       "5" (F5)     "E" (C5)    "N" (D5) 
     6       "6" (F6)     "F" (C6)    "O" (D6) 
     7       "7" (F7)     "G" (C7)    "P" (D7) 
     8       "8" (F8)     "H" (C8)    "Q" (D8) 
     9       "9" (F9)     "I" (C9)    "R" (D9)



and again a more detailed one at simotime




Syam
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Feb 26, 2009 3:46 pm    Post subject:
Reply with quote

murugan_mf wrote:
What is the difference in adding an extra comma.

The syntax of SIGNS sub parameter is as shown below.

SIGNS=(s1,s2,s3,s4)
s1= leading positive sign indicator
s2= leading negative sign indicator
s3= trailing positive sign indicator
s4= trailing negative sign indicator

There's no difference between the two forms in your case since you need a leading sign byte(+/-). But if you needed trailing signs, you should provide the commas like this as the values are positonal.
Code:
ZD,EDIT=(TTTTTTTTTS),SIGNS=(,,+,-))
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Feb 26, 2009 6:40 pm    Post subject:
Reply with quote

Arun,

Thanks!
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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