IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to achieve through Sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1742
Location: Tirupur, India

PostPosted: Thu Feb 10, 2011 12:46 pm
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: 2481
Location: @my desk

PostPosted: Thu Feb 10, 2011 1:18 pm
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: 1742
Location: Tirupur, India

PostPosted: Thu Feb 10, 2011 1:23 pm
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
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: 2481
Location: @my desk

PostPosted: Thu Feb 10, 2011 1:42 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top