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

How to increase size of ZD in sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Wed May 09, 2012 11:08 am
Reply with quote

i have a requierement to change S9V99 to S99V999 in sort. Can someone tell if its possible

Ip is like
Code:

A 10}
B 12A
C 00B


o/p is to be
Code:

A 0100}
B 0121}
C 0002}
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 09, 2012 11:21 am
Reply with quote

Taking an extra byte, try something like:

Code:
1,2,PD,MUL,+10,TO=PD,LENGTH=3
Back to top
View user's profile Send private message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Wed May 09, 2012 8:39 pm
Reply with quote

i have tried and leading zeroes are are not present. Any help?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 09, 2012 8:44 pm
Reply with quote

What do you mean the leading zeros are not present? You've looked at the file in hex and see what? Or are you trying to "display" it for a human?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 09, 2012 8:46 pm
Reply with quote

Hello,

What did you get as output (please show in hex).

The topic mentions ZD, but the sample code shows PD. Which have you tried?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 09, 2012 9:16 pm
Reply with quote

Yoy, you're so right Dick. Didn't even notice after the second post, sorry about that.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed May 09, 2012 9:18 pm
Reply with quote

umanaga,
umanaga wrote:

i have a requierement to change S9V99 to S99V999 in sort.

What does this suppose to mean? What you asked for conversion ( leading zero) but the example you show is NOT leading zeros.

What do you need? Do you need to mutiply with 10 (10} to 0100}) or leading zero (10} to 0010})? Use below method based on your req.

p,m,f,to=f,length=n. In your example if i am not wrong, your input is ZD starting at 3rd position,so you would need 3,3,ZD,TO=ZD,LENGTH=5. This would add leading zeros and produce something like below for the input you have shown...
Code:
0010}
00121
00002

If you want to multiply with 10, you would need 3,3,ZD,MUL,+10,TO=ZD,LENGTH=5 and produce something like below for the input you have shown...
Code:
0100}
01210
00020

Thanks,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 09, 2012 9:31 pm
Reply with quote

umanaga wrote:
i have a requierement to change S9V99 to S99V999 in sort. Can someone tell if its possible

Ip is like
Code:

A 10}
B 12A
C 00B


o/p is to be
Code:

A 0100}
B 0121}
C 0002}


umanaga,

Something doesn't make sense here
Quote:

10} = -100 and 0100} = -1000 OK ( multiply by 10)
12A = +121 and 0121} = -1210 How did a positive value become negative?
00B = +2 and 0002} = -20 Same as above


You need to define the rules to get that output
Back to top
View user's profile Send private message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Thu May 10, 2012 11:42 am
Reply with quote

oops..sorry i used wrong sign

o/p is to be
Code:

A 0100{
B 0121{
C 0002{


approach suggested by sqlcode1 is working..thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 10, 2012 10:48 pm
Reply with quote

Code:

  OPTION COPY                                   
  INREC OVERLAY=(3:3,3,ZD,MUL,+10,TO=ZDC,LENGTH=4) 


would give this output:

Code:

A 100} 
B 121{ 
C 002{ 


Is that what you want?
Back to top
View user's profile Send private message
umanaga

New User


Joined: 09 Apr 2007
Posts: 33
Location: India

PostPosted: Fri May 11, 2012 2:47 pm
Reply with quote

yes. 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 -> DFSORT/ICETOOL

 


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 Increase the number of columns in the... IBM Tools 3
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top