• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

  • To Comfort The Afflicted And Afflict The Comfortable
  • How FalconStor Is Reinventing Itself, And Why IBM Noticed
  • Guru: When Procedure Driven RPG Really Works
  • Vendors Fill In The Gaps With IBM’s New MFA Solution
  • IBM i PTF Guide, Volume 27, Number 27
  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26

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