Question on CL.

555 pts.
Tags:
CL/400
Hi Group,
I would like to enter input to a CL pgm through console. For example,
My CL PGM should take file name as the input from the console and has to display the number of records that are present in that file.
Thanks in Advance,
MVRK

Answer Wiki

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

Hi Krishna,

You can Send an message to user for entering the File name using SNDUSRMSG and capture the same using CL Variable.

<pre> PGM
DCL VAR(&FILENM) TYPE(*CHAR) LEN(10)
SNDUSRMSG MSG(‘Enter File Name’) MSGRPY(&FILENM)
END: ENDPGM </pre>

You can proceed with the Remaining File Operations(Display or Write) as ususal.

Pradeep.

Discuss This Question: 3  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
  • Teandy
    Look at the SNDRCVF command.
    5,860 pointsBadges:
    report
  • TomLiotta
    I would like to enter input to a CL pgm through console. Are you having a problem with this? What problem are you seeing? Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    Check out PMTOPR (prompt operator) command. Works well. No display file coding required. Includes some basic input validation.
    6,520 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