View previous topic :: View next topic
|
Author |
Message |
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
Back to top |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
Hi,
Can any one please let me know the list of ALTSEQ hex representations link?
Thanks and Regards,
Nath R. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
rguhanath
New User
Joined: 16 Oct 2006 Posts: 81 Location: chennai
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|