Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Want to achieve through Sort

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

New User


Joined: 21 Dec 2007
Posts: 88
Location: My Desk

PostPosted: Thu Feb 10, 2011 12:04 pm    Post subject: Want to achieve through Sort
Reply with quote

Input:

Code:
12345.67
 2345.6
  345.67
   45.67
    5.67


OUTPUT needed:

Code:
1234567
0234560
0034567
0004567
0000567


I want achieve this thru sort.
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Thu Feb 10, 2011 12:46 pm    Post subject:
Reply with quote

Hi,

Please provide more details when posting, like LRECL, RECFM, length of the bytes & the sort product you have..
If you have DFSORT, then you could try the below code.

Assuming the LRECL=80 & RECFM = FB & the numeric field length as 8 bytes.


Code:
//JS020    EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//TEMPWORK DD DSN=&&TEMP,DISP=(NEW,PASS,DELETE),SPACE=(CYL,(1,9),RLSE),
//            RECFM=FB,LRECL=80                                         
//SORTIN   DD DISP=SHR,DSN=WELLS.SORTIN                               
//SORTOUT  DD DSN=WELLS.SORTOUT,DISP=OLD                             
//SYSOUT   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
  COPY FROM(SORTIN) TO(TEMPWORK) USING(CTL1)                           
  COPY FROM(TEMPWORK) TO(SORTOUT) USING(CTL2)                           
/*                                                                     
//CTL2CNTL   DD *                                                       
  INREC FINDREP=(STARTPOS=1,ENDPOS=7,IN=X'40',OUT=C'0')                 
/*                                                                     
//CTL1CNTL   DD *                                                       
  INREC BUILD=(1,5,7,2,9,72,80:C' ')                                   
/*                                                                     
//SYSUDUMP DD SYSOUT=*                                                 
/* 


Hope it helps.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Thu Feb 10, 2011 1:18 pm    Post subject:
Reply with quote

I am away from office and can't run a test now. But I believe a simple INREC pass like this would suffice the OP's requirement.
Code:
//SYSIN DD *
  OPTION COPY
  INREC BUILD=(1,8,UFF,EDIT=(TTTTTTT))
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Thu Feb 10, 2011 1:23 pm    Post subject:
Reply with quote

This is slick icon_smile.gif

Regards,
Back to top
View user's profile Send private message
PrabakarV

New User


Joined: 21 Dec 2007
Posts: 88
Location: My Desk

PostPosted: Thu Feb 10, 2011 1:38 pm    Post subject:
Reply with quote

Code:
//SYSIN     DD *                         
  OPTION COPY                           
  INREC FIELDS=(1,5,7,2)                 
  OUTREC FINDREP=(IN=(X'40'),OUT=(X'F0'))
/*         


I tried the above... it worked perfectly... thanks for the icetool alternative...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Thu Feb 10, 2011 1:42 pm    Post subject:
Reply with quote

Prabakar,

I just noticed that I got the UFF thing wrong. Good that you figured the right one out. You may try this one, which has just the INREC pass alone.
Code:
  SORT FIELDS=COPY
  INREC FINDREP=(STARTPOS=1,ENDPOS=8,
        INOUT=(C' ',C'0',C'.',C''))
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us