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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: I want to delete COMMA (,) for input records.
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 31, 2010 5:20 pm    Post subject:
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    Post subject: Reply to: I want to delete COMMA (,) for input records.
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

Senior Member


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

PostPosted: Wed Sep 01, 2010 2:13 am    Post subject:
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    Post subject: Reply to: I want to delete COMMA (,) for input records.
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: 2360
Location: Israel

PostPosted: Wed Sep 01, 2010 2:05 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Sep 01, 2010 2:16 pm    Post subject: Reply to: I want to delete COMMA (,) for input records.
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: 8593
Location: Back in jolly old England

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

O

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

Senior Member


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

PostPosted: Wed Sep 01, 2010 3:53 pm    Post subject: Re: Reply to: I want to delete COMMA (,) for input records.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Sep 01, 2010 4:01 pm    Post subject: Reply to: I want to delete COMMA (,) for input records.
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    Post subject: Reply to: I want to delete COMMA (,) for input records.
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

Site Director


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

PostPosted: Wed Sep 01, 2010 10:45 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Sep 01, 2010 11:59 pm    Post subject:
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

Site Director


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

PostPosted: Thu Sep 02, 2010 12:29 am    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Sep 02, 2010 1:44 am    Post subject:
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: 500
Location: USA

PostPosted: Thu Sep 02, 2010 2:56 am    Post subject:
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

Senior Member


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

PostPosted: Thu Sep 02, 2010 10:50 am    Post subject:
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    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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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