View previous topic :: View next topic
|
Author |
Message |
PrabakarV
New User
Joined: 21 Dec 2007 Posts: 88 Location: My Desk
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
This is slick
Regards, |
|
Back to top |
|
|
PrabakarV
New User
Joined: 21 Dec 2007 Posts: 88 Location: My Desk
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|