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

Putting apostrophes into a CHAR variable

I'm trying to write a very small CL program to send my workstation a break message -- with the output being the text I would use for a SAV command. The problem is that in the SAV command some PARMs need to have the apostrophe included, i.e. '/QSYS.LIB/TAP01.DEVD'. How do I put the apostrophe into a CHAR variable without the program thinking that it is the end of the string?

You will need to put double-single quotes around your quotes.

Example:

DCL VAR(&TEST) TYPE(*CHAR) LEN(5)
CHGVAR VAR(&TEST) VALUE('''abc''')

This will produce a quoted value in the variable test 'abc'

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


This was last published in February 2004

Dig Deeper on iSeries ILE programming

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...

Close