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

Sign representation using sync sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Wed Feb 25, 2009 6:25 pm
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

Superior Member


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

PostPosted: Wed Feb 25, 2009 7:17 pm
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
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
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: 2481
Location: @my desk

PostPosted: Thu Feb 26, 2009 3:46 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


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