Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Remove junk characters by keeping the 'good' characters
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8638
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 11:53 pm    Post subject:
Reply with quote

Hello,

The good news is that if you use COBOL, the entire determination of good versus bad character becomes a single IF statement icon_smile.gif

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
View user's profile Send private message
References
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 12
Location: Harrisburg, Pennsylvania

PostPosted: Fri Jul 25, 2008 12:12 am    Post subject: That's gr88
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Jul 25, 2008 1:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 12
Location: Harrisburg, Pennsylvania

PostPosted: Fri Jul 25, 2008 1:43 am    Post subject: V2005
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8638
Location: 221 B Baker St

PostPosted: Fri Jul 25, 2008 2:10 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8638
Location: 221 B Baker St

PostPosted: Fri Jul 25, 2008 2:29 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Jul 25, 2008 2:42 am    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2