Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT/Icetool Doubt...Help needed!!!!!

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

New User


Joined: 04 May 2006
Posts: 4

PostPosted: Tue May 09, 2006 11:30 am    Post subject: SORT/Icetool Doubt...Help needed!!!!!
Reply with quote

I have an INPUT file.The layout of input file is given below.Taking this as
Input need to create an Ouput file (Layout given below) based on the following condition.

Need to eliminate the $ sign from the input file, more than one Spacings which comes between the First and Second Names with single spacing and have to create the output file as given below .

Any idea how i can do this using SORT/Icetool (no cobol pls)

Code:

Input File
-----------
Mark$$Spencer       1204505678AB546776 SWS
Peter$$$$Shildon    1204505678AB546776 SWS
Dirk$$$$$$M$$ Tyle  5678490022CC695486 MFT


Code:

Output File
--------------
Mark Spencer        1204505678AB546776 SWS
Peter Shildon       1204505678AB546776 SWS
Dirk M Tyle         5678490022CC695486 MFT


Thanks in advance

Byte
I
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 09, 2006 8:21 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's new SQZ function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(1:1,20,SQZ=(SHIFT=LEFT,PREBLANK=C'$',
    MID=C' '))
/*
Back to top
View user's profile Send private message
byte
Currently Banned

New User


Joined: 04 May 2006
Posts: 4

PostPosted: Wed May 10, 2006 10:17 am    Post subject: Re: SORT/Icetool Doubt...Help needed!!!!!
Reply with quote

Thanks Frank for your wonderful and quick reply..

I went thru the link as well which you sent ;the illustartion for SQZ in that is very straight forward to understand..

Byte..
Back to top
View user's profile Send private message
byte
Currently Banned

New User


Joined: 04 May 2006
Posts: 4

PostPosted: Wed May 10, 2006 10:22 am    Post subject: INREC OVERLAY vs OUTREC FIELDS
Reply with quote

Frank,
In manual the usage given is

OPTION COPY
OUTREC FIELDS=(1,20,SQZ=(SHIFT=LEFT,MID=C',')) can I use this too?

Also pls let me know why you have used INREC OVERLAY?

INREC OVERLAY=(1:1,20,SQZ=(SHIFT=LEFT,PREBLANK=C'$',
MID=C' '))


Thanks in advance

Byte
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 10, 2006 8:31 pm    Post subject:
Reply with quote

Quote:
Also pls let me know why you have used INREC OVERLAY?


I used INREC OVERLAY because you just wanted to change the first 20 bytes without changing the rest of the record. OVERLAY=(1:1,20,SQZ...) only affects the first 20 bytes without affecting anything else. That's what you asked for.

Quote:
In manual the usage given is

OPTION COPY
OUTREC FIELDS=(1,20,SQZ=(SHIFT=LEFT,MID=C',')) can I use this too?


Huh? That's valid syntax but it has nothing to do with your requirement. It will shift left and put a comma wherever it finds a blank between the first nonblank and last nonblank. It will also only give you the first 20 bytes of the input records in your output records. For your example, that would give you the following output which is not what you asked for:

Code:

Mark$$Spencer       
Peter$$$$Shildon   
Dirk$$$$$$M$$,Tyle 


whereas the INREC statement I showed you would give you the following output which is what you asked for:

Code:

Mark Spencer        1204505678AB546776 SWS 
Peter Shildon       1204505678AB546776 SWS 
Dirk M Tyle         5678490022CC695486 MFT 


You have to use the right control statements to get what you want.
Back to top
View user's profile Send private message
byte
Currently Banned

New User


Joined: 04 May 2006
Posts: 4

PostPosted: Thu May 11, 2006 10:25 am    Post subject: Icetool/Sort help needed
Reply with quote

Frank,
It was a mistake from my when sent

The actual syntax was

OPTION COPY
OUTREC FIELDS=(1,20,SQZ=(SHIFT=LEFT,PREBLANK=C'$',MID=C' '))

can I use this too?

Thanks

Byte
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 11, 2006 8:50 pm    Post subject:
Reply with quote

I'm having a hard time figuring out what you want to do. I gave you the syntax needed to go from the input to the output you showed in your first post. Are you trying to get different output now?

Code:

  OPTION COPY
  OUTREC FIELDS=(1,20,SQZ=(SHIFT=LEFT,PREBLANK=C'$',MID=C' '))


would give you the following 20-byte output records:

Code:

Mark Spencer   
Peter Shildon 
Dirk M Tyle   


If that's what you want for output instead of the output you said you wanted originally (with all of the fields), then you can use that syntax to get it. If you want the output you originally said you wanted, then you need to use the syntax I gave you.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Thu May 11, 2006 9:01 pm    Post subject:
Reply with quote

Hi Byte,

Maybe you can try the following as an alternate:

//STEP011 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN= input file here
//SORTOUT DD DSN=output file here
// DISP=(NEW,CATLG,CATLG)
// SPACE=(CYL,(20,20),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
OUTREC=(1,820,TRAN=ALTSEQ)
ALTSEQ CODE=(4A40)
/*

This should be the record length of your input file.
4A is the HEX Code for $ and 40 is that for SPACE

Hope this helps you!
Cheers, Twissi.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 11, 2006 9:21 pm    Post subject:
Reply with quote

Twissi,

'$' is X'5B', not X'4A' and using TRAN=ALTSEQ like that will just replace each '$' with a blank. That will NOT give just one blank between the names as was requested. Your output would be:

Code:

Mark  Spencer       1204505678AB546776 SWS
Peter    Shildon    1204505678AB546776 SWS
Dirk      M   Tyle  5678490022CC695486 MFT


Go back to the first post and you'll see that's not the output requested. The DFSORT job I showed does give the output requested which is:

Code:

Mark Spencer        1204505678AB546776 SWS   
Peter Shildon       1204505678AB546776 SWS   
Dirk M Tyle         5678490022CC695486 MFT   
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri May 12, 2006 12:08 pm    Post subject:
Reply with quote

Frank,

I was just about to leave from office Y'day when I saw that request, may be I failed in understanding the problem because of the lack of time.
Thaks for pointing it out .

However, I still believe '$' is X'4A' :

Code:
//***$?           TO DELETE ALL TEMP FILES                             
665554544444444444ED4CCDCEC4CDD4ECDD4CCDCE444444444444444444444444444444
11CCCAB00000000000360453535013303547069352000000000000000000000000000000


X'5B' is '?'

Please correct me if I'm wrong, thanks.

Thanks, Twissi.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri May 12, 2006 8:34 pm    Post subject:
Reply with quote

Here's what I see for the same line:

Code:

//***?$           TO DELETE ALL TEMP FILES
665554544444444444ED4CCDCEC4CDD4ECDD4CCDCE444444444444444444...
11CCCAB00000000000360453535013303547069352000000000000000000...


My yellow card with the EBCDIC codes and Appendix D of "DFSORT Application Programming Guide" both show 4A as the cent sign and 5B as the dollar sign. I believe these are the standard EBCDIC codes. You're probably displaying these values as your local currency symbols by way of a different code page. Maybe somebody who knows more about such things can explain it more clearly.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Tue May 16, 2006 1:17 pm    Post subject:
Reply with quote

Frank, thanks a ton for your thoughts.

Regards, Twissi.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us