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
 

 

How to increase size of ZD in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to increase size of ZD in sort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed May 09, 2012 11:21 am    Post subject: Reply to: How to increase size of ZD in sort
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed May 09, 2012 8:44 pm    Post subject: Reply to: How to increase size of ZD in sort
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

Site Director


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

PostPosted: Wed May 09, 2012 8:46 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed May 09, 2012 9:16 pm    Post subject: Reply to: How to increase size of ZD in sort
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: 578
Location: USA

PostPosted: Wed May 09, 2012 9:18 pm    Post subject:
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    Post subject: Re: How to increase size of ZD in sort
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    Post subject:
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 Moderator


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

PostPosted: Thu May 10, 2012 10:48 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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