fhg
Volume 7, Number 40 -- November 14, 2007

Odds and Ends

Published: 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:\temp\myfile.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


Sponsored By
COMMON

Save the date for COMMON's 2008 Annual Meeting and Exposition,
March 30 - April 3, 2008 in Nashville, Tennessee, at the Gaylord Opryland Resort.

This premier System i education and networking event is COMMON's largest event of the year, offering five full days of System i education and evening socials.

The conference will feature well over 500 educational sessions, hands-on labs, and all-day workshops covering a wide variety of topics in solutions development, infrastructure management, and business/ professional development. There will be sessions on hot topics like PHP, DB2 Web Query, IP Telephony, Domino 8 and IBM's next new release: i5/OS V6R1. There will also be sessions aimed at IT Strategy, IT Leadership and personal development, to accommodate your less technical roles at work. All classes are delivered by the most respected and knowledgeable presenters in the industry.

In addition to the leading edge education, the Annual Meeting and Exposition provides an invaluable networking forum for attendees to interact with their System i community. After a full day of education, the evening iSocial events provide attendees the opportunity to relax, have some fun, and exchange knowledge and real-world experiences with fellow attendees, speakers, solution providers and IBM. iSociety Face-to-Face Sessions offer attendees the ability to hold "face-to-face" discussions on any special interest topic - technical or otherwise. The contacts you make at the conference will be as valuable as the education you receive.

You will also have access to the world's largest System i-related Exposition, which encompasses more that 80 of the leading industry exhibitors, including a large IBM presence. The COMMON Exposition provides a one-stop source of up-to-the-minute information and products for the IT industry. Discover what's new in the System i world, and learn how you and your company can reduce costs and improve productivity by leveraging the products and services featured at the COMMON Exposition. You can compare and contrast your alternatives, and discover which solution best suits your needs.

Finally, the Annual Meeting and Exposition is the place for you to hear from the Board of Directors about COMMON, and is your chance to communicate with them in person. Bring your questions, comments and feedback to the meeting of the members at the Annual Meeting and Exposition.

COMMON's 2008 Annual Meeting and Exposition will offer:
· Over 500 sessions and hands-on labs in a range of choices every hour
· i5/OS V6R1 sessions
· Customer experience sessions and new speakers
· In-depth education through all-day pre-conference workshops, all-day Integrated Seminars,
   open labs
· Emphasis on networking that provides great opportunities to network with your peers,
   IBM developers, executives, and industry experts
· iSocial events for fun and relaxation
· An extensive Exposition of new companies showcasing the latest System i-related
   industry solutions

The COMMON 2008 Annual Meeting and Exposition is a
System i educational and networking event that
you and/or your team won't want to miss.
To learn more about the conference visit

www.common.org


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
Power6 Blades Finally Come to Market from IBM

Power Systems Division: A New Unit, i5/OS and iCluster Included

System i VIP Initiative Boosts Sales, Says IBM

As I See It: The Paradox

The Linux Beacon
Red Hat to Use Automation, Virtualization to Eat the Server Space

Red Hat Puts Out Fedora 8 Rev of Development Linux

Intel Announces First "Penryn" Xeon Processors

Mad Dog 21/21: Symphony for the Devil

Four Hundred Stuff
PowerTech Ships i5/OS Syslog Connector for SIEM

Change Management Software Gets Boost from Mighty Ant

Attachmate Ships Emulator, Touts Tolly Report

BCD Delivers Major Update of WebSmart ILE

Big Iron
Neuwing, IBM to Quantify and Monetize IT Energy Savings

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
November 10, 2007: Volume 9, Number 45

November 3, 2007: Volume 9, Number 44

October 27, 2007: Volume 9, Number 43

October 20, 2007: Volume 9, Number 42

October 13, 2007: Volume 9, Number 41

October 6, 2007: Volume 9, Number 40

The Windows Observer
Visual Studio 2008 to Ship By End of November

Intel Quietly Releases 'Montvale' Itanium Kickers

Microsoft Unveils Free Enterprise Search Product

Windows Home Server Now Available

The Unix Guardian
Sun Wrings Profits from a Flat Fiscal First Quarter

Power6 Blades Finally Come to Market from IBM

Intel Quietly Releases 'Montvale' Itanium Kickers

IBM Brags About Its Power6 Server Shipments

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

ProData Computer Services
COMMON
WorksRight Software


Printer Friendly Version


TABLE OF CONTENTS
ON vs. WHERE

Odds and Ends

Admin Alert: How Big is My IFS?

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
IBM 6400 on LPT1 prints junk

Reallocate disk space from one LPAR to another

How to retrieve a workstation ID

Finding *OUTFILE Template Files

i5/OS V5R4 Release Notes





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement