Q
Problem solve Get help with specific problems with your technologies, process and projects.

Creating a user profile from a file

iSeries i5/OS expert Ken Graap helps a user with creating a user profile from a file.

I am writing a program to create user profile from a file. For OUTQ, INLPGM, INLMENU, I get error: CPD0078. The value for parameter is not a valid name.

Here is how I built the parameters:

DCL &INLPGM TYPE(*CHAR) LEN(21)

Then I dumped the copy from user profile to an outfile:

If &UPINPG = '*NONE', then &INPPGM = *none Else do chgvar &INLPGM value(&upinpl *TCAT '/' *TCAT &upinpg)

What can I do to fix this error?

A program name can only be 10 characters long.

Change &INLPGM to LEN(10) ... If &INLPGM is being passed to the program as Library/ProgramName, then you will need to use the %SST function to break it into two parameters.

For example:

DCL        VAR(&OUTQ) TYPE(*CHAR) LEN(20) 

DCL        VAR(&OUTQNAME) TYPE(*CHAR) LEN(10)
DCL        VAR(&OUTQLIB) TYPE(*CHAR) LEN(10) 

CHGVAR     VAR(&OUTQNAME) VALUE(%SST(&OUTQ 1 10)) 
CHGVAR     VAR(&OUTQLIB) VALUE(%SST(&OUTQ 11 10))

Good Luck!

This was last published in July 2007

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close