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

Removing spaces and inserting comma using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Dec 13, 2010 2:58 pm
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.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
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Dec 13, 2010 4:32 pm
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Dec 13, 2010 7:11 pm
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Dec 14, 2010 12:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top