SSN ID format in AS/400

820 pts.
Tags:
AS/400
IBM iSeries
Physical File
Hi,
I am new to this technology. I need to create some fields on Physical file which should accept the data in the format of SSN ID (123-456-789).
Kindly let me know. How can I go with this? If this is an older question, please forgive me & post that older link.
Thanks


Software/Hardware used:
AS400 database

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Habbie,

Assuming your question is related to Display file field for accepting SSN ID.
You could make use of EDTWRD keyword for corresponding SSN ID field. 
You will need to mention break with ‘-’ after three digits. Your EDTWRD key word for corresponding field will look like this.

EDTWRD( – – ).
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r5/topic/com.ibm.etools.iseries.langref2.doc/rzakc/rzakcmstdfedwrd.htm

You can refer above link for detailed info on EDTWRD

Pradeep.

Discuss This Question: 15  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • hunshabbir7
    I think you should try EDTWRD keyword for this field. 
    1,440 pointsBadges:
    report
  • HABBIE
    Hi Pradeep,

    Thanks for the reply. Is it possible to mention any condition along the field itself.so that I can enter values on these fields on a physical file.As, I am not looking for a display file.
    820 pointsBadges:
    report
  • BigKat
    if you want to store it in a physical file with the dashes, you need to store it as an 11 character field  (11A)
    most often, this is stored as a 9 digit numeric field (9P0 or 9S0) and formatted at display/print time with EDTWRD.
    8,200 pointsBadges:
    report
  • philpl1jb

    As Big Kat said SSN is usually handled and stored as a numeric 9

    And SSN is most often shown as 999-99-9999

    When the population of the US reaches 1 billion.  It's going to be another Y2K type issue. 

    49,930 pointsBadges:
    report
  • HABBIE
    Thanks
    820 pointsBadges:
    report
  • HABBIE
    If i want to place Space(' ') instead of hyphen. I mean 123 456 789. How to achieve this?
    Thanks
    820 pointsBadges:
    report
  • HABBIE
    I tried with 
    0006.00                   SSN_ID_4       9S 0       EDTWRD('   " "  " "    ')   

    But it throws an error like: 
    * CPD7528      20        1      Message . . . . :   Number of decimal replace positions not valid.     

    Kindly correct me, If I am wrong.

    820 pointsBadges:
    report
  • Splat
    Use an ampersand for blanks, e.g.: '   &  &    '
    7,215 pointsBadges:
    report
  • HABBIE
    @Splat Thanks . It's working now.
    820 pointsBadges:
    report
  • HABBIE
    If I need a combination of characters like AN 12 BY 45 78 U.
    How to go for this. kindly let me know
    820 pointsBadges:
    report
  • Splat
    The first question would be what purpose is to be served - are you  attempting to mask all or part of the SS#?

    The second would be how are the characters to be derived or generated - are they dependent on the SS# or are they randomly determined? 
    7,215 pointsBadges:
    report
  • philpl1jb

    AN 12 BY 45 78 U

    If these characters are variable then

    - this cannot be a numeric field

    - this cannot use edit word or edit code

    - this could be 5 fields of 2 characters and 1 of 1

    - this could be a field of 11 without blanks

    - this could be a field of 16 with blanks

     

    49,930 pointsBadges:
    report
  • ToddN2000
    You mention "a combination of characters like AN 12 BY 45 78 U". Yet your original question stated "a format of SSN ID (123-456-789)."  If this format varies from record to record, I see no way to apply a mas to handle the spacing of data.
    11,025 pointsBadges:
    report
  • HABBIE
    Yes, Initially I started with 123-456-789.Later I need to go for these .Any where what I can do these, I can take a Character field to store the required format. 
    820 pointsBadges:
    report
  • ToddN2000
    Sounds like it will vary. Your best bet may be to create a work filed like "result" and string the different input data fields together and store that in your data base.. Something like these examples.

    /*  TRIM TRAILING BLANKS  */                                            
    C                   eval      result = %TRIMR(fld1 + ' ' + fld2 + ' ' + 
    C                             fld3 + ' ' +fld4 + ' ' + fld5)            
                                                                            
    /*  TRIM LEADING BLANKS  */                                             
    C                   eval      result = %TRIML(fld1 + ' ' + fld2 + ' ' + 
    C                             fld3 + ' ' +fld4 + ' ' + fld5)            
                                                                            
    /*  JUST CONCAT FIELD TOGETHER   */                                     
    C                   eval      result =(fld1 + ' ' + fld2 + ' ' +        
    C                             fld3 + ' ' +fld4 + ' ' + fld5)            
    11,025 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following