MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To change the sign using SYNCSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rasprasads
Beginner


Joined: 10 Dec 2002
Posts: 59
Topics: 20
Location: Chennai

PostPosted: Thu Dec 26, 2002 7:56 am    Post subject: To change the sign using SYNCSORT Reply with quote

How to change the sign of a Packed decimal field using SYNCSORT ?.
Is there any way to multiply by -1 or any other solution to this.

Thanks
_________________
Rasprasad S
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu Dec 26, 2002 7:58 am    Post subject: Reply with quote

rasprasads,

Yes you can change the sign . post the lrecl,position of the string to be changed and the format of the string.

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rasprasads
Beginner


Joined: 10 Dec 2002
Posts: 59
Topics: 20
Location: Chennai

PostPosted: Thu Dec 26, 2002 8:18 am    Post subject: Reply with quote

Kolusu,

Thanks for your quick response

The parameters are:
LRECL=640 and the field size is 8 bytes(S9(10)V9(5) comp-3).
Position of the field=12.
_________________
Rasprasad S
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu Dec 26, 2002 9:24 am    Post subject: Reply with quote

Rasprasads,

There are 2 ways of changing the sign. you can use a change command to change the sign on the last byte of the field in question or you can use horizontal math function (add,sub,mul,div) to change the sign.

Choose whichever you like

Code:

//STEP0100 EXEC PGM=SORT
//*                                           
//SYSOUT   DD  SYSOUT=*                       
//SORTIN   DD  DSN=YOUR INPUT FILE,     
//             DISP=SHR                       
//SORTOUT  DD  DSN=YOUR OUTPUT FILE,           
//             DISP=(NEW,CATLG,DELETE),       
//             UNIT=SYSDA,                     
//             SPACE=(CYL,(X,Y),RLSE)       
//SYSIN    DD  *                               
  SORT FIELDS=COPY                                           
  INREC FIELDS=(1,18,                   
                19,1,CHANGE=(1,X'1C',X'1D',X'1D',X'1C',
                             X'2C',X'2D',X'2D',X'2C',X'3C',X'3D',X'3D',X'3C',
                             X'4C',X'4D',X'4D',X'4C',X'5C',X'5D',X'5D',X'5C',
                             X'6C',X'6D',X'6D',X'6C',X'7C',X'7D',X'7D',X'7C',
                             X'8C',X'8D',X'8D',X'8C',X'9C',X'9D',X'9D',X'9C'),
                     NOMATCH=(19,1),
                20,621)                   
/*


Method:2
Code:

//STEP0100 EXEC PGM=SORT
//*                                           
//SYSOUT   DD  SYSOUT=*                       
//SORTIN   DD  DSN=YOUR INPUT FILE,     
//             DISP=SHR                       
//SORTOUT  DD  DSN=YOUR OUTPUT FILE,           
//             DISP=(NEW,CATLG,DELETE),       
//             UNIT=SYSDA,                     
//             SPACE=(CYL,(X,Y),RLSE)       
//SYSIN    DD  *                               
  SORT FIELDS=COPY
  INREC FIELDS=(1,11,                       $ FIRST 11 BYTES
               -1,MUL,12,8,PD,PD,LENGTH=8,  $ MULTIPLY WITH -1 FOR PD
                20,621)                     $ REST OF THE FIELDS
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rasprasads
Beginner


Joined: 10 Dec 2002
Posts: 59
Topics: 20
Location: Chennai

PostPosted: Sat Dec 28, 2002 7:53 am    Post subject: Reply with quote

Kolusu,
Thanks a lot for your patience and help...
I tried the second solution using arithmetic function MUL and it worked fine...

Thanks
_________________
Rasprasad S
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group