|
|
| Author |
Message |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7998 Location: 221 B Baker St
|
|
|
|
Hello,
The good news is that if you use COBOL, the entire determination of good versus bad character becomes a single IF statement
You'd need to define the GOOD-CHAR as a condition name, but that can be done with 'A' THRU 'I', etc rather than naming every value. |
|
| Back to top |
|
 |
References
|
Posted: Thu Jul 24, 2008 11:53 pm Post subject: Re: |
 |
|
|
 |
Sagar_mainframe
New User
Joined: 07 Jun 2008 Posts: 12 Location: Harrisburg, Pennsylvania
|
|
|
|
Dick,
I have implemented part 2) in COBOL using INSPECT verb as follows
part 2) "Also if any special characters like `~!@#$%^&*()_-+=\|:";'{}[]?/>.<, present at the end or in between (means column 24 to column 47 for last name and column 49 to column 62 for first name) of the first name or last name that also i have to replace it with space X'40'. "
| Code: |
100-100-CHECK-RECORD.
INSPECT WS-CUST01-REC(23:62) CONVERTING "." TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "~" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "`" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "!" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "@" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "#" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "$" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "%" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "^" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "&" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "*" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "(" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING ")" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "_" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "-" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "+" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "," TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "/" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "?" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "'" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING ">" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING ":" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING ";" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "=" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "\" TO " "
INSPECT WS-CUST01-REC(23:62) CONVERTING "<" TO " ".
|
But , I'm still in doubt , to implement part 1) means removing any special charater from position 23 (starting position of LAST NAME)and position 48(starting position of FIRST NAME) and after removal, shift the rest of the text in that field towards left without disturbing the positions of other fields in records..
Can you please give me glimpse of code to implement the part 1) ? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4392 Location: San Jose, CA
|
|
|
|
| Quote: |
| I think 'JFY' function is not supported by the vrsion of DFSORT/ISPF, is that the case? |
For the record, DFSORT has supported JFY since April, 2006. |
|
| Back to top |
|
 |
Sagar_mainframe
New User
Joined: 07 Jun 2008 Posts: 12 Location: Harrisburg, Pennsylvania
|
|
|
|
| OK Frank, I think mine is 2005....if you look at the top-line of the snapshot (code posted) of error encountered ... |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7998 Location: 221 B Baker St
|
|
|
|
Hello Sagar,
You need to pay closer attention. . .
To repeat - You are not using DFSORT - you are using Syncsort. . . . They are entirely different products. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7998 Location: 221 B Baker St
|
|
|
|
Hello Sagar,
To do what you want for part 1 (removing unwanted characters), i'd suggest defining a field to "receive" the corrected string and initialize it to spaces. Then positon yourself at the beginning of the input field and the receiving field. If the current character is "good", move it to the receiving field and increment the position in both fields. If the current character is not "good" only increment the input field positon.
To define the good charactgers, i'd use something like:
| Code: |
01 A-CHAR PIC X.
88 GOOD-CHAR VALUES ARE '0' THRU '9',
'A' THRU 'I',
'J' THRU 'R',
'S' THRU 'Z',
'a' THRU 'i',
'j' THRU 'r',
's' THRU 'z'.
|
If you have questions while you're coding/testing, post the problem code here and someone will be able to clarify. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4392 Location: San Jose, CA
|
|
|
|
| Quote: |
| OK Frank, I think mine is 2005....if you look at the top-line of the snapshot (code posted) of error encountered ... |
Sagar,
I was just responding to your statement that "I think 'JFY' function is not supported by the vrsion of DFSORT/ISPF, is that the case?". For the record, I wanted to make it clear that DFSORT has supported JFY for a long time. Since Dick pointed out previously that you are using Syncsort, not DFSORT, I didn't see the need to repeat that, but maybe I should have. |
|
| Back to top |
|
 |
|
|