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

Sort to convert s9(7)v99 to s9(9)v99 and move space to + val


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

New User


Joined: 03 Jun 2008
Posts: 14
Location: chennai

PostPosted: Mon Feb 08, 2010 11:26 am
Reply with quote

Hi,

I am in need of help. Can anyone help me out?

I want to convert s9(7)v99 to s9(9)v99 in sort and move space to + values...

Eg:
i/p file

S9(7)v99

Code:

-000009876
 000006253
-000008276
+000006253
+000001111


i want output as

S9(9)v99

Code:

-0000009876
 0000006253
-0000008276
 0000006253
 0000001111
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: Tue Feb 09, 2010 12:07 am
Reply with quote

Code:

S9(9)v99

-0000009876
 0000006253
-0000008276
 0000006253
 0000001111


S9(9)v99 would have 11 digits, but you are only showing 10 digits - why?

If you want to convert s9(7)v99 (= 9 digits) to s9(9)v99 (= 11 digits), you just need to add two leading zeros. An easy way to do that (and change a + sign to a blank) would be with these DFSORT control statements:

Code:

  OPTION COPY                                   
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'+'),         
        BUILD=(C' 00',2,9)),                   
    IFTHEN=(WHEN=NONE,BUILD=(1,1,C'00',2,9))   
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top