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
 

 

How eliminate APOS(') in the record.

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

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 4:48 pm    Post subject: How eliminate APOS(') in the record.
Reply with quote

Hi All,

i am having the following file which is having the records like..

record length is 80, Recformat is FB.

Code:


'adklslds        adlkdjflsdfa      'kdsldl
'dfldksldkfjlkdsjldfj'ldfjdlfjlajdfjljljlj
'dfdj      kdjfl      dklsjdfldfjl'dlsdfjl



Now i want the output file with eliminate the (') Apostrophe from the records.like below..

Code:

adklslds        adlkdjflsdfa      kdsldl
dfldksldkfjlkdsjldfjldfjdlfjlajdfjljljlj
dfdj      kdjfl      dklsjdfldfjldlsdfjl



Please let me know if there is any way to remove ' without SHIFING LEFT the spaces in the record.

Thanks and Regards,
Nath R.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu May 22, 2008 5:02 pm    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

rgu,

Quote:
Now i want the output file with eliminate the (') Apostrophe from the records.like below..


You can use the PREBLANK feature of ICETOOL to remove one or more charecters. Please search the DFSORT forum for examples. Also check the topic "squeeze out blank or other characters" in the foll here
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu May 22, 2008 5:20 pm    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

If its for one time requirment, then you can use ' C ALL OPTION'

Like -

C ALL "'" ''




Include singel apos(') into two double apos (") and after giving one space write two single apos(')
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 5:21 pm    Post subject:
Reply with quote

Hi Aaru,

i have searched in the forum(DFSORT) and didn't get any exact solution. and also i checked in the "smart tricks in DFSORT" PDF, there aslo explained first squeezing and then add one space. other ex tells just remoce the '!' from the record. but in that records there is no spaces. but in my case i want spaces also after squeezing.. please tell if there is any solution...

Thanks and Regards,
Nath R
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu May 22, 2008 5:40 pm    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

rgu,

Quote:
i have searched in the forum(DFSORT) and didn't get any exact solution.


No. I searched the forum and found a similar topic. Just scroll down and read Frank's Post in this link

Frank has used an interesting Logic for that requirement.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 5:46 pm    Post subject:
Reply with quote

Hi Aaru,

i have checked fully sice 2 hours in the same book, Sorry i didn;t get any thing related to this requirement. please let me know the page number if you know exactly and please help me...

Thanks and Regards,
Nath R.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 5:48 pm    Post subject:
Reply with quote

i have one idea to do this....

first we need to insert some special char in to the spaces using ALTSEQ and then after we can remove (') from the records using squeezing and then we can replace the special char with spaces using ALTSEQ.

please correct me if it wrong and please let me know the jcl...

Thanks and Regards,
Nath R
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu May 22, 2008 5:54 pm    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

The hex representation of an apostrophe is X'7D'.

Why not change X'7D' to X'40'?

X'40' is a blank.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu May 22, 2008 6:02 pm    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

rgu,

Did u check the link in my earlier post?


click this link for the topic
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 6:08 pm    Post subject:
Reply with quote

Hi cpuhawg,

Thanks!!
i dont want to replace with blank. Totally i want remove (') from the record. i want to know that yours logic is works for getting the result like.

(...adlkdjflsdfa kdsldl) instead of (...adlkdjflsdfa 'kdsldl)

means, is change to 'Blank' will shift to left the record. please let me know that jcl if it works like above result.

Thanks and Regards,
Nath R
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 6:25 pm    Post subject:
Reply with quote

Hi Aaru,

Sorry... now only i checked your link and i saw the solution which is given by Frank. This logic is what i say in my previous post. i will try with this logic. Any way it is not a healthy logic for data in the records. because might be the special char will be there in the data in future. that time it will show worng report by using this logic. Any way Thanks.

Regards,
Nath R.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Thu May 22, 2008 6:35 pm    Post subject:
Reply with quote

Hi,

Can any one please let me know the list of ALTSEQ hex representations link?

Thanks and Regards,
Nath R.
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: Fri May 23, 2008 12:52 am    Post subject:
Reply with quote

Hello,

Quote:
let me know the list of ALTSEQ hex representations link
There is no "list" of altseq values. ALTSEQ allows you to substitute one value for another - you choose the values.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri May 23, 2008 5:02 am    Post subject: Reply to: How eliminate APOS(') in the record.
Reply with quote

rguhanath,

Here is DFSORT JCL which would do what you asked for. Using ALTSEQ we first convert all the spaces (X'40') to a symbol which doesn't exist in the file at all. for ex I used @ symbol (X'7C') and we also convert the apostrophe (X'7D') to spaces (X'40')

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
'ADKLSLDS        ADLKDJFLSDFA      'KDSLDL                 
'DFLDKSLDKFJLKDSJLDFJ'LDFJDLFJLAJDFJLJLJLJ                 
'DFDJ      KDJFL      DKLSJDFLDFJL'DLSDFJL                 
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INREC BUILD=(1,80,TRAN=ALTSEQ)                           
  ALTSEQ CODE=(407C,7D40)                                   
//*                                                         


After completion of the step the output looks like this

Code:

 ADKLSLDS@@@@@@@@ADLKDJFLSDFA@@@@@@ KDSLDL@@@@@@@@@@@
 DFLDKSLDKFJLKDSJLDFJ LDFJDLFJLAJDFJLJLJLJ@@@@@@@@@@@
 DFDJ@@@@@@KDJFL@@@@@@DKLSJDFLDFJL DLSDFJL@@@@@@@@@@@


Now we can use the SQZ function to squeeze out the blanks. Once we squeeze out the blanks once AGAIN we use ALTSEQ to convert the @ symbol back to spaces

Code:

//STEP0200 EXEC PGM=ICEMAN               
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD DSN=&&T1,DISP=SHR         
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                         
  SORT FIELDS=COPY                       
  INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))   
  OUTREC BUILD=(1,80,TRAN=ALTSEQ)       
  ALTSEQ CODE=(7C40)                     


The final output now is

Code:

ADKLSLDS        ADLKDJFLSDFA      KDSLDL
DFLDKSLDKFJLKDSJLDFJLDFJDLFJLAJDFJLJLJLJ
DFDJ      KDJFL      DKLSJDFLDFJLDLSDFJL


Which is the desired output without the apostrophe

Check this link which shows all the EBCDIC collating sequence with hex representation.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/APPENDIX1.3.1?

Hope this helps...

Cheers
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Fri May 23, 2008 11:42 am    Post subject:
Reply with quote

Hi Skolusu,

Thanks for your gr8 help.

its work fine now. Even though i want to know there is any simple porcess is there to do like these type of requirement. means any inbuild tool in DFSORT. and also please let me know is there only two ways (PAIR=QUOTE and PAIR=APOST) are available for paring the string. theare is no other customise the characotrs aprt from QUOTE and APOST.

Thanks and Regards,
Nath R.
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 Aug 14, 2008 2:22 am    Post subject:
Reply with quote

You can now use DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to do this kind of thing quite easily like this:

Code:

//S1   EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD *                                                   
'ADKLSLDS        ADLKDJFLSDFA      'KDSLDL                       
'DFLDKSLDKFJLKDSJLDFJ'LDFJDLFJLAJDFJLJLJLJ                       
'DFDJ      KDJFL      DKLSJDFLDFJL'DLSDFJL                       
//SORTOUT DD SYSOUT=* 
//SYSIN    DD    *                                               
  OPTION COPY                                                   
  INREC FINDREP=(IN=C'''',OUT=C'')                               
/*


For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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