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
 

 

Reformating numeric data using sync sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Tue Mar 29, 2011 7:09 pm    Post subject: Reformating numeric data using sync sort
Reply with quote

Hi All,

I have data like below in a file.

Code:

C(1-10)
----------
-456.99 
22479   
9289   
26659.13
39999   
-34859 



But i need data should be like this:

Code:


-000456.99 
 022479.00   
 009289.00   
 026659.13
 039999.00   
-034859.00



Please let me know how we can do this using syncsort?

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

hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Fri Apr 01, 2011 6:08 pm    Post subject:
Reply with quote

Hi,
Try this card, it should work..

Code:

//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(1,10,SS,NE,C'.'),                             
          OVERLAY=(8:C'.00',20X),HIT=NEXT),                         
        IFTHEN=(WHEN=(1,10,SS,EQ,C'.'),                             
          BUILD=(1:1,10,SQZ=(SHIFT=RIGHT)),HIT=NEXT),               
        IFTHEN=(WHEN=(25,1,CH,EQ,C' '),                             
          FINDREP=(STARTPOS=1,ENDPOS=10,IN=C' ',OUT=C'0'),HIT=NEXT),
        IFTHEN=(WHEN=(1,10,SS,EQ,C'-'),                             
          OVERLAY=(1:C'-'),HIT=NEXT),                               
        IFTHEN=(WHEN=(2,9,SS,EQ,C'-'),                             
         FINDREP=(STARTPOS=2,ENDPOS=9,IN=C'-',OUT=C'0'),HIT=NEXT), 
        IFTHEN=(WHEN=(1,1,CH,NE,C'-'),                             
          OVERLAY=(1:C' '))                                         


Thanks,
Ashwin.
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Sat Apr 02, 2011 10:41 pm    Post subject:
Reply with quote

Try below, you need to give the editing characters as per your requirement

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
789
0001
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC OVERLAY=(1,4,UFF,EDIT=(TTTT))
/*



Code:

0789
0001


Hope this helps ....
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Thu Apr 07, 2011 4:02 pm    Post subject:
Reply with quote

abraralum,
I doubt this will solve the given scenario where there are fractionals for only some data. You will some how have to force the decimal point or else it would be misplaced.
Please correct me if I am wrong.

Thanks,
Ashwin.
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Thu Apr 07, 2011 8:52 pm    Post subject:
Reply with quote

I came through something like today at my work ... but I have not tested the below sort card.

Code:

INREC OVERLAY=(1,4,UFF,EDIT=(TTTT.TT))
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Fri Apr 08, 2011 10:28 am    Post subject:
Reply with quote

I did try the below code and it did not work. I found the decimal point getting misplaced. But I am not sure if am missing something.

Code:

  OPTION COPY                                             
  INREC OVERLAY=(1,8,UFF,EDIT=(STTTTT.TT),SIGNS=(+,-,,))


But the earlier code which i posted would work even if it seems to be a bit round about way. Anyway, there should be a better way of doing it.

Thanks,
Ashwin.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Fri Apr 08, 2011 10:34 am    Post subject:
Reply with quote

No offense, but I would say we should try out the code before posting it as a solution.

Thanks,
Ashwin.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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