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

I want to delete COMMA (,) for input records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Tue Aug 31, 2010 5:11 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 31, 2010 5:20 pm
Reply with quote

Which sort product and release level.
Back to top
View user's profile Send private message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Tue Aug 31, 2010 5:31 pm
Reply with quote

Hi,

Thanks for reply.

I am using SYNCSORT FOR Z/OS 1.3.0.3R.

Thanks,
Ranjith.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 01, 2010 2:13 am
Reply with quote

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
View user's profile Send private message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Wed Sep 01, 2010 12:46 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Sep 01, 2010 2:05 pm
Reply with quote

For not-too-large datasets, REXX's STRIP function will do the job.

O.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 01, 2010 2:16 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Sep 01, 2010 2:33 pm
Reply with quote

O

Didn't you mean TRANSLATE rather than STRIP
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 01, 2010 3:53 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 01, 2010 4:01 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Wed Sep 01, 2010 10:10 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 01, 2010 10:45 pm
Reply with quote

Hello,

So, how many more surprises are you withholding. . . icon_sad.gif

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 01, 2010 11:59 pm
Reply with quote

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...icon_sad.gif icon_confused.gif

And I hope, you've already read the assumptions from my previous post.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 02, 2010 12:29 am
Reply with quote

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 icon_sad.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Sep 02, 2010 1:44 am
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Sep 02, 2010 2:56 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Sep 02, 2010 10:50 am
Reply with quote

PS. Somtimes theses threads are so irritating...grin!
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 DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top