Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
harithaganna

New User

Joined: 03 Jun 2008
Posts: 14
Location: chennai

Posted: Mon Feb 08, 2010 11:26 am    Post subject: Sort to convert s9(7)v99 to s9(9)v99 and move space to + val

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

Frank Yaeger

DFSORT Moderator

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

Posted: Tue Feb 09, 2010 12:07 am    Post subject:

 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))
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am VSAM File free space sancraig16 JCL & VSAM 14 Fri Mar 30, 2018 1:02 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us