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
 

 

Removing spaces and inserting comma using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 12:59 pm    Post subject: Removing spaces and inserting comma using sort
Reply with quote

Hi all,

My requirement is as below

Input file
Description
-------------
inv-type(4 spaces) inv-descr (10 spaces) inv-space (spaces)
(11 spaces) inv-descr (11 spaces)inv-type(spaces)inv-item


Output file should be

Description
-------------
inv-type, inv-descr, inv-space
inv-descr, inv-type, inv-item

In the above output file all the spaces have been removed (wherever it may be ) and inserted comma in between those descriptions.

It starts with 83 and ends with 252 in the input file. the length is 169.
Please help me on this.

Thanks
Back to top
View user's profile Send private message

karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 1:34 pm    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Hi,

The DFSORT version which I use is

Z/OS DFSORT V1R5
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Dec 13, 2010 2:58 pm    Post subject:
Reply with quote

Your description is very poor. Is the input description one or two records?
Is the output file one or two records?


Quote:
It starts with 83 and ends with 252 in the input file. the length is 169.
This doesn't seem right. If 'something' starts in byte 83 and ends in byte 252, it's 170 bytes long. But then what is 'it' ?

Have you checked User Guide for DFSORT PTFs UK90007 and UK90006 @ ftp://ftp.software.ibm.com/storage/dfsort/mvs/sortpeug.pdf ? Check out he SQZ function - I think it'll do what you want.

Garry.
Back to top
View user's profile Send private message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 3:31 pm    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Hi Garry,

It is 2 records.

Description
-------------
inv-type(4 spaces) inv-descr (10 spaces) inv-space (spaces) - 1 st record
(11 spaces) inv-descr (11 spaces)inv-type(spaces)inv-item - 2nd record

this is a field part of the input file so it starts with 83 and ends with 252. we can assume 1 to 170 also.

I tried using SQZ and i got the below error

INREC OVERLAY=(83:83,251,SQZ= (SHIFT=LEFT),83:83,251,
TRAN=LTOU) $

ICE006A 0 OPERAND DEFINER ERROR
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E7-K90000

My DFSORT version is V1R5. Not sure whether this works in this version.

Thanks.
Back to top
View user's profile Send private message
Guest







PostPosted: Mon Dec 13, 2010 3:48 pm    Post subject:
Reply with quote

Hi Karthi,
From the way i understood the requirement the following job can be used:
Code:

 //STEP010  EXEC PGM=SORT                         
 //SORTIN DD *                                   
 ABC    DEF    HKLINJ                             
 ABC   DEF    HKLINJ                             
 ABC    DEF   HKLINJ                             
 ABC   DEF    HKLINJ                             
 ABC    DEF   HKLINJ                             
 //SORTOUT  DD SYSOUT=*                           
 //SYSIN    DD *                                 
  OPTION COPY                                     
  INREC BUILD=(1,6,7,13,SQZ=(SHIFT=LEFT,MID=C','))
 /*                                               
 //SYSUDUMP DD SYSOUT=*                           
 //SYSPRINT DD SYSOUT=*                           
 //SYSOUT   DD SYSOUT=*                           


The output of the same will be:
Code:

ABC   DEF,HKLIN
ABC   DEF,HKLINJ
ABC   DEF,HKLINJ
ABC   DEF,HKLINJ
ABC   DEF,HKLINJ


you can modify the same to reach to your requirement.
Please correct me if i have not understood your requirement.
Back to top
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 4:22 pm    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Hi devil,

Thanks for your solution. I tried it but as i mentioned earlier the SQZ command is not working in my DFSORT installation. My version is
Z/OS DFSORT V1R5.

I am getting the below error

OPTION COPY
INREC BUILD=(1,6,7,13,SQZ=(SHIFT=LEFT,MID=C','))
$
ICE006A 0 OPERAND DEFINER ERROR
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E7-K90000
ICE052I 3 END OF DFSORT


Please let me know in case it can be achieved thru any other commands.

Thanks
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Dec 13, 2010 4:32 pm    Post subject:
Reply with quote

Please use the code tags to show jobs and job output - otherwise, what you show as JCL, code or output may be misaligned.

The '$' usually aligns with where the error is found. I this case it seems to be at the INREC statement which suggests that you coded in column 1. If it were complaining of the SQZ parameter, the '$' would be aligned there.

Garry.
Back to top
View user's profile Send private message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 4:53 pm    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Garry,

It is because of alignment problem, the actual issue is with SQZ. It is showing $ in SQZ only. Sorry about that.

Code:


 OPTION COPY                                     
 INREC BUILD=(1,6,7,13,SQZ=(SHIFT=LEFT,MID=C','))
                       $                         

Back to top
View user's profile Send private message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Dec 13, 2010 6:35 pm    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Hi,

Is there any other command other than SQZ in sort to achieve the above requirement. Please guide me on this.

Hope my requirement is clear.

Thanks.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Dec 13, 2010 7:11 pm    Post subject:
Reply with quote

I think you'll probably have to wait for Frank or Kolusu for this. They are probably due to login soon....

Garry.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 13, 2010 11:06 pm    Post subject: Re: Reply to: Removing spaces and inserting comma using sort
Reply with quote

karthi_ind wrote:
Hi,

Is there any other command other than SQZ in sort to achieve the above requirement. Please guide me on this.

Hope my requirement is clear.

Thanks.


If you are getting an error using SQZ then you probably are way behind installing PTF's. As is z/OS DFSORT V1R5 is out of service and is no longer supported. You should be using one of the supported releases - z/OS DFSORT V1R10 or z/OS DFSORT V1R12. The SQZ function is available for both of those releases.
Back to top
View user's profile Send private message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Tue Dec 14, 2010 8:47 am    Post subject: Reply to: Removing spaces and inserting comma using sort
Reply with quote

Hi Kolusu,

Thanks for your reply.

My installation is internal to our organisation. So I can't use the version as mentioned in your reply.

Please let me know if there is anyother way to achieve this. (other than SQZ function)

Thanks
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Dec 14, 2010 12:52 pm    Post subject:
Reply with quote

If there was another way with DFSORT, I reckon Kolusu would have
told you. icon_rolleyes.gif

I suggest you try some other approach.

Garry.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 5 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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