• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Validating a User Password

    August 21, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have an application in which I would like to use electronic signatures. We are in a federally regulated industry and it is required to have this process password protected. To make things easy on the users I would like to use their normal AS/400 passwords. Is there a method for validating a user ID and password?

    — David

    Take a look at the Check Password (CHKPWD) command. It requires one parameter: the password of the user profile under which it is running. If the password is not correct, CHKPWD sends one of the following escape messages:

    CPF2362   Password not correct.

    CPF2363   Only 1 attempt left to check password.

    CPF2364   Maximum number of attempts to check password reached.

    CHKPWD won’t prompt you for the password, so you’ll need to provide the user some way to enter it. The following display file DDS defines a non-display input field for that purpose:

    A                                      DSPSIZ(24 80 *DS3)
    A          R SCRN01
    A                                  4  6'Enter your password to - 
    A                                      continue:'
    A            PWD           10A  I  4 40
    A                                      DSPATR(ND)
    A            MSG           78     24  2
    

    This CL program prompts for the password and executes the CHKPWD command:

    PGM                                                
                                                          
       DCLF       FILE(PWD1D)
    
    RETRY:
       SNDRCVF
       CHKPWD PASSWORD(&PWD)
       MONMSG MSGID(CPF2362) EXEC(DO)
           CHGVAR VAR(&MSG) +
                    VALUE('Invalid password; try again.')
           GOTO RETRY
       ENDDO
    

    — Ted

    Sponsored By
    COMMON

    REGISTER FOR COMMON IN DENVER, OCT. 13-17

    Get the IT training you need by attending COMMON Users Group’s Fall 2002 IT Education Conference & Expo, October 13-17 in Denver. Early Bird registration is $1,150 until September 4.

    Choose from over 720 sessions and labs covering a wide range of industry topics. Also receive training from J.D. Edwards, MAPICS, and other vendors.

    Don’t miss out! Go to www.common.org

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 63 -- August 21, 2002

    Sponsored by
    Rocket Software

    Meet digital age demands while maximizing your IT investment.

    Future-proof your mission-critical applications with Rocket® Solutions for IBM® i that keep your business ahead of the curve.

    Learn More

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Creating HTML Subfiles More on TCP/IP Printing

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 63

This Issue Sponsored By

    Table of Contents

    • OPNQRYF Bug
    • Debugging Java in Eclipse
    • Validating a User Password

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • POWERUp 2025 –Your Source For IBM i 7.6 Information
    • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
    • Guru: Creating An SQL Stored Procedure That Returns A Result Set
    • As I See It: At Any Cost
    • IBM i PTF Guide, Volume 27, Number 19
    • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
    • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
    • i-Rays Brings Observability To IBM i Performance Problems
    • Another Non-TR “Technology Refresh” Happens With IBM i TR6
    • IBM i PTF Guide, Volume 27, Number 18

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle