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
 

 

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: 1491
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: 2275
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: 1491
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: 2275
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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