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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort to convert s9(7)v99 to s9(9)v99 and move space to + val
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 Moderator


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

PostPosted: Tue Feb 09, 2010 12:07 am    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
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 Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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