• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Odds and Ends

    November 14, 2007 Hey, Professional

    It’s been a while since we ran an article of odds and ends. Here are several short tips for working with the Integrated File System (IFS). I hope you find something useful.

    Question:

    The Work with Object Links (WRKLNK) panel doesn’t show complete file names. What I see is the first 18 characters of a file name, a space, and a greater-than sign, like this:

    Sales (3Q-2007) Re >
    Sales (3Q-2007) Re >
    Sales (3Q-2007) Re >
    Sales (3Q-2007) Re >
    Sales (3Q-2007) Re >
    

    Is there a way to make it show the complete names?

    Answer:

    You’re close. Just add DETAIL(*NAME) to the WRKLNK command.

    WRKLNK OBJ('/tmp/salesanalysis/*') DETAIL(*NAME)
    

    You can also use DETAIL(*NAME) with the Display Object Links (DSPLNK) command to see complete file names.

    DSPLNK OBJ('/tmp/salesanalysis/*') DETAIL(*NAME)
    

    Also, try Qshell’s “ls” utility, with a one-switch instead.

    ls -1                       
    Sales (3Q-2007) Region 1.xml
    Sales (3Q-2007) Region 2.xml
    Sales (3Q-2007) Region 3.xml
    Sales (3Q-2007) Region 4.xml
    Sales (3Q-2007) Region 5.xml
    

    The one-switch tells it to list one file per line.

    Question:

    We are creating a scheduled process to transmit files from an IFS directory. Sometimes there may be no files to transmit when the scheduled job activates. I would like to add a preliminary step to count the files in that particular directory and then abort the remainder of the process if there are no files to process. We will be transmitting via SFTP using Qshell commands encapsulated in a CL driver program. This would seem very simple, but I’ve looked and I can’t find a simple Qshell method to count files in a directory. BTW, there will be no links and no subdirectories either.

    Answer:

    You can use the “wc” utility (with the ell-switch) to count the number of files in a directory.

    ls | wc -l
    

    The problem is getting the data back to the CL program. One method you might try is to create a data area to hold the count. CL has a command just for that.

    crtdtaara mylib/filecount *char 24
    

    In your Qshell script, use the “datarea” (notice the goofy spelling) utility to stuff the file count into the data area.

    ls | wc -l | datarea -w /qsys.lib/mylib.lib/filecount.dtaara
    

    Getting data back from Qshell is always a problem. I haven’t found a solution that I like yet.

    You might also want to take a look at this thread in the IT Jungle Web Forums.

    Question:

    Suppose I want to use the Work with Object Links (WRKLNK) command with files that whose names contain the string “rtv.” I thought I could use the wild card character to get a subset list.

    wrklnk '*rtv*'
    

    But the system responds with error CPD0816 (Path name cannot begin with *.) and CPF0001 (Error found on WRKLNK command.) What do I do?

    Answer:

    Preposterous, ain’t it? Prefix the wild card expression with a period and a slash.

    wrklnk './*rtv*'
    

    The period stands for the current directory.

    Question:

    Can you help me with an FTP script? I want to transfer files from the Integrated File System into a Windows directory.

    Answer:

    Are you running the FTP client on the PC? If so, put the following commands after the login sequence:

    quote site namefmt 1
    get /home/myfile.txt c:tempmyfile.txt
    

    Substitute the proper paths and file names in the “get” command. You will have an ASCII transfer by default, which is probably what you want. If not, use the “bin” command to transfer in binary mode.

    Reader Feedback

    Hey Ted:

    I read your tips and enjoy them a lot. Your tips inspired me to dive into IFS and Qshell. I tried your tip Finding Large IFS Directories and it is very cool. There is a small point that I noticed and would like to share with all. I noticed that there were some class files in my IFS directory against which I could not see a * by using the -F option with the ls command. (The -F switch appends / to directory names, * to executables, and @ to symbolic links.) After looking for a while, I found that one should have explicit execute authority (-x) over a file to see this -F option to show the expected results.

    Please keep on posting more IFS tricks and tips.

    –Pankaj



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Maxava

    Migrate IBM i with Confidence

    Tired of costly and risky migrations? Maxava Migrate Live minimizes disruption with seamless transitions. Upgrading to Power10 or cloud hosted system, Maxava has you covered!

    Learn More

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    ARCAD Software:  Dynamic, world-class ALM on and around the System i
    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    NowWhatJobs.net:  NowWhatJobs.net is the resource for job transitions after age 40

    IT Jungle Store Top Book Picks

    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    Oracle Launches ‘Business Accelerator’ for J.D. Edwards EnterpriseOne Be My Guest

    Leave a Reply Cancel reply

Volume 7, Number 40 -- November 14, 2007
THIS ISSUE SPONSORED BY:

ProData Computer Services
COMMON
WorksRight Software

Table of Contents

  • ON vs. WHERE
  • Odds and Ends
  • Admin Alert: How Big is My IFS?

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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