View previous topic :: View next topic
|
Author |
Message |
ranjith12
New User
Joined: 02 Sep 2008 Posts: 6 Location: chenni
|
|
|
|
HI,
I want to delete COMMA (,) in input file for all the records using SORT.
Input file:
-----------
record1: 2010,0915,2010-10-20
record2: 2010,0915,2009-08-09
Output file should be:
-----------
record1: 201009152010-10-20
record2: 201009152009-08-09
Please let me know the SORT card for above.
Thanks,
Ranjith. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Which sort product and release level. |
|
Back to top |
|
|
ranjith12
New User
Joined: 02 Sep 2008 Posts: 6 Location: chenni
|
|
|
|
Hi,
Thanks for reply.
I am using SYNCSORT FOR Z/OS 1.3.0.3R.
Thanks,
Ranjith. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
ALTSEQ or FINDREP can be helpful. Support for FINDREP was included in SyncSort for z/OS 1.3.2. So below card will be of no use for you version of SyncSort, though it's my preferred way of doing it:
Code: |
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C',',OUT=C'')
/* |
For ALTSEQ solution, I need to know if you want "," to be replaced by a "space" or want to squeeze the fields to left/right? Though with FINDREP they are squeezed to left, by default. |
|
Back to top |
|
|
ranjith12
New User
Joined: 02 Sep 2008 Posts: 6 Location: chenni
|
|
|
|
I dont have DFSORT utility.
any way I did thru filemanger
here is code
Code: |
//STEP010 EXEC PGM=FILEMGR,REGION=4M
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=* |
.
.
Code: |
//SYSIN DD *
$$FILEM DSC INPUT=DD01,
$$FILEM OUTPUT=DD01O,
$$FILEM PROC=*
OUTREC = CHANGE(OUTREC,',','')
OUTREC = CHANGE(OUTREC,',','')
OUTREC = CHANGE(OUTREC,',','')
OUTREC = CHANGE(OUTREC,',','')
OUTREC = CHANGE(OUTREC,',','')
OUTREC = CHANGE(OUTREC,',','')
OVLY_OUT(' ',70,11)
/+ |
Thanks,
Ranjith. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
For not-too-large datasets, REXX's STRIP function will do the job.
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
You might not have DFSORT utilities like You call them
SYNCSORT is the competitor of DFSORT and as such provides the <same> general functions and capabilities |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
O
Didn't you mean TRANSLATE rather than STRIP |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
ranjith12 wrote: |
I dont have DFSORT utility. |
When did I mention about that? I just said that with your version of SyncSort, you won't be able to use FINDREP - which actually works well for your situation.
For your release of SyncSort, try this:
Code: |
//STEP001 EXEC PGM=SORT
//SORTIN DD *
2010,0915,2010-10-20
2010,0915,2009-08-09
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
ALTSEQ CODE=(6B40)
INREC FIELDS=(1,80,TRAN=ALTSEQ)
OUTREC FIELDS=(1,80,SQZ=(SHIFT=LEFT))
//SYSOUT DD SYSOUT=* |
which gives
Code: |
201009152010-10-20
201009152009-08-09 |
Assumptions: input/output are of LRECL=80, RECFM=FB. And you want to "move the characters to LEFT". |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
but if the record layout is fixed ...
why not something along the lines of
Code: |
OPTION COPY
OUTREC BUILD(1,1,4,5,6,4,... the rest of the record and the filler ) |
just a hint to be looked up in the manual |
|
Back to top |
|
|
ranjith12
New User
Joined: 02 Sep 2008 Posts: 6 Location: chenni
|
|
|
|
HI Anuj,
Above specified SORT card works for me to deletes comas.
But numaric data replaces with some Junk values.
Here is the output:
Code: |
¥^£^^¾£§¥^£^-£^-¥^
¥^£^^¾£§¥^^¾-^½-^¾ |
pls advise me.
Thanks,
Ranjith. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
So, how many more surprises are you withholding. . .
If you can't be bothered to completely post what you are trying to do and all of the info about the data (and where you are stuck), no one can advise you. . .
Suggest you post a few sample records (in hex) that contain everything you need to address. Then someone may be able to post a more usable suggestion. . . |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Ranjith - I'm not sure why would that happen. At my shop, X'6B' represents comma (,) - how about yours? Something to do with code-pages, I doubt it . Suggest you show some sample input (as Dick says) and possibly the hex equivalent of the sample. So that I can remove the egg from face...
And I hope, you've already read the assumptions from my previous post. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If the data contains binary numerics, any hex value is possible and valid. . . Meaning a general "change all" will not work. . .
If we are shown "real" data, we can proceed. Without it, not so likely |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Expat,
Quote: |
Didn't you mean TRANSLATE rather than STRIP |
TRANSLATE is a nice alternative, but personally - I prefer STRIP. The STRIPped character (third argument) could be any valid character...
O. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
I don't see the issue here, unless I am missing something.
Code: |
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
2010,0915,2010-10-20
2010,0915,2009-08-09
//SYSIN DD *
INREC BUILD=(1,4,6,4,11,10)
SORT FIELDS=COPY
/* |
Output produced:
Code: |
201009152010-10-20
201009152009-08-09 |
Is this not what was asked for? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
PS. Somtimes theses threads are so irritating...grin! |
|
Back to top |
|
|
|