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

How eliminate APOS(') in the record.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Thu May 22, 2008 4:48 pm
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: 1287
Location: Chennai, India

PostPosted: Thu May 22, 2008 5:02 pm
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
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 5:21 pm
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: 1287
Location: Chennai, India

PostPosted: Thu May 22, 2008 5:40 pm
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 5:46 pm
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 5:48 pm
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
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: 1287
Location: Chennai, India

PostPosted: Thu May 22, 2008 6:02 pm
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 6:08 pm
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 6:25 pm
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: 81
Location: chennai

PostPosted: Thu May 22, 2008 6:35 pm
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

Moderator Emeritus


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

PostPosted: Fri May 23, 2008 12:52 am
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
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.

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: 81
Location: chennai

PostPosted: Fri May 23, 2008 11:42 am
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 Developer


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

PostPosted: Thu Aug 14, 2008 2:22 am
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:

Use [URL] BBCode for External Links
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top