• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Presenting the CHGATR Command

    October 20, 2004 Hey, Ted

    I had a similar problem to Jim’s in “Wanted: Qshell Output in ASCII.” Qshell was building EBCDIC files, but he wanted them in ASCII. In my case, a “Wintel” machine’s FTP client was putting ASCII files in the Integrated File System, but I preferred EBCDIC files. I found a CL command that solved my problem.

    I used the Change Attributes (CHGATR) command. This command, which was introduced in V5R1, can change the CCSID of a file. I used commands like the following to change files from CCSID 819 (the CCSID they were assigned when they were created during an FTP session) to 37 (US English):

    CHGATR OBJ('/mydir/myfile.txt') ATR(*CCSID) VALUE(37)
    

    I need to point out that CHGATR does not convert the data in the file to the new CCSID. In my case, I sent a second put command and everything was fine. Here is a portion of an illustrative script:

    lcd /temp
    cd /mydir
    put empty.txt mynewfile.txt
    quote rcmd CHGATR OBJ('mynewfile.txt') ATR(*CCSID) VALUE(37)
    put myrealpcfile.txt mynewfile.txt
    

    The empty.txt file is not really empty. I had keyed one x into it. Copying it to the IFS created a file with a code page of 819. Then I used the rcmd server command to change the CCSID. Last, I copied the real data to the IFS.

    The other ways to change a file’s CCSID that were presented in “Wanted: Qshell Output in ASCII” and “More Qshell Output in ASCII” are fine, but I wanted to mention this CL command.

    –Ken

    Thanks for bringing CHGATR to our command. As you point out, it is a relatively new command.

    You can use CHGATR against a single file or a group of files whose names match a pattern. If you specify SUBTREE(*YES), the system will also change objects in subdirectories.

    In addition to changing a file’s CCSID, CHGATR can change the following properties.

    Property Description
    *READONLY Whether a file can be changed or deleted.
    *HIDDEN Whether a file is displayed in an ordinary directory list.
    *PCSYSTEM Whether a file is considered as belonging to a PC.
    *PCARCHIVE Whether a file has been changed since the last save by a PC.
    *SYSARCHIVE Whether a file has been changed since an iSeries save.
    *ALWCKPWRT Whether a stream file can be shared during save-while-active checkpoint processing.
    *USECOUNT The number of days an object has been used.
    *DISKSTGOPT How the system allocates auxiliary storage for an object.
    *MAINSTGOPT How the system allocates main storage for an object.


    Be aware that not all options are available in every file system.

    To learn more about CHGATR, go to the IBM iSeries Infocenter.

    –Ted

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    GST Targets IBM with Internal AIT Tape Drives for i5 and p5 Move iSeries Forward and Adapt, or Die, Zeitler Says

    Leave a Reply Cancel reply

Volume 4, Number 35 -- October 20, 2004
THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
Guild Companies
WorksRight Software

Table of Contents

  • Prolong the FTP Experience
  • Presenting the CHGATR Command
  • Admin Alert: Cracking the Obscure CWBLM0029 PC5250 Error

Content archive

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

Recent Posts

  • The Power11 Transistor Count Discrepancies Explained – Sort Of
  • Is Your IBM i HA/DR Actually Tested – Or Just Installed?
  • Big Blue Delivers IBM i Customer Requests In ACS Update
  • New DbToo SDK Hooks RPG And Db2 For i To External Services
  • IBM i PTF Guide, Volume 27, Number 33
  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32

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