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 

Changing the Signed byte pf Packed-decimal (COMP-3)

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


Joined: 12 Aug 2005
Posts: 1
Topics: 1

PostPosted: Tue Aug 30, 2005 7:35 am    Post subject: Changing the Signed byte pf Packed-decimal (COMP-3) Reply with quote

Hi Frank,
We have a file where the signed byte in a COMP-3 fields has a value 'F' for positive and 'B' for negative.

But we are using tool which accepts only 'C' for positive and 'D' for negative.

Is there any way I can accomplish this conversion using the ICETOOL.

regards
Jayan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 30, 2005 8:18 am    Post subject: Reply with quote

JayanRNair,

Assuming that your COMP-3 field is at pos1 for a length of 5 bytes, the following JCL will convert the 'F' sign to a 'C' and the 'b' Sign to 'D'

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(+1,MUL,1,5,PD,PD,LENGTH=5)
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Aug 30, 2005 10:00 am    Post subject: Reply with quote

Jayan,

I'd suggest using DFSORT's OVERLAY operand instead of FIELDS for this kind of thing since OVERLAY makes it easier to handle multiple fields without worrying about the rest of the record. For example, if you have 5-byte PD fields starting at positions 1 and 26, you could use this DFSORT job:

Code:

//S2 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file
//SORTOUT DD DSN==...  output file
//SYSIN    DD *
  OPTION COPY
  OUTREC OVERLAY=(1:1,5,PD,TO=PD,LENGTH=5,
                  26:26,5,PD,TO=PD,LENGTH=5)
/*


Note that the trick works because DFSORT uses C and D signs for TO=PD conversions.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Fri May 05, 2006 12:52 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Fri Sep 09, 2005 4:43 pm    Post subject: Reply with quote

Jayan,
In addition to Kolusu's and Frank Yaeger's advice, in the control card you need to put remaining length of the record

OUTREC FIELDS=(+1,MUL,1,5,PD,PD,LENGTH=5,6,75) (assuming 80 is the lrecl)

Thanx,
Lal
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Sep 09, 2005 5:41 pm    Post subject: Reply with quote

Quote:
In addition to Kolusu's and Frank Yaeger's advice, in the control card you need to put remaining length of the record


Lal,

That's true for Kolusu's example with FIELDS, but is NOT TRUE for my example with OVERLAY. I guess you didn't read what I said about OVERLAY. DFSORT's OVERLAY function just overlays the indicated field - it does NOT affect other fields before or after the overlaid field and you do NOT specify these fields with OVERLAY. That's why I said "OVERLAY makes it easier to handle multiple fields without worrying about the rest of the record".

For complete details on DFSORT's OVERLAY function and the other DFSORT and ICETOOL functions available with the Dec, 2004 DFSORT PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri May 05, 2006 12:55 pm    Post subject: Reply with quote

Note that with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) you can now use TO=PDC or TO=PDF to indicate the positive sign you want for converted values. TO=PDC is equivalent to TO=PD and gives a C sign for positive numbers and a D sign for negative numbers. TO=PDF gives an F sign for positive numbers and a D sign for negative numbers.

For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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