LS Consulting

  • Home
  • About
  • Blog
  • Contact

CL

Notes

Submitting a job as a different user

We are all familiar with the SBMJOB command, but it’s rare that anyone looks beyond the first few parameters. Until you need to. One overlooked parameter is USER which allows you to specify the name of the user profile for the job being submitted. Obviously, you need to have enough Read more…

By Paul, 4 years4 years ago
Notes

Copying data between heterogeneous databases with CPYFRMIMPF

Last week I mentioned the CPYTOIMPF command and how easy it makes reformatting data so that it can be handled by other platforms. Not surprisingly the IBM i makes it just as easy to handle data coming back with the CPYFRMIMPF command. Using the same files as last time, the Read more…

By Paul, 4 years4 years ago
Notes

Copying data between heterogeneous databases with CPYTOIMPF

One of the many things that the IBM i (and its predecessors) has always been good at is exchanging data with other platforms. And one thing that often surprises me is that people often don’t realise just how easy sharing data can be. How easy? This easy CPYTOIMPF FROMFILE(MRKRPT01) TOSTMF(‘/home/PAUL/MarketingReport.csv’) Read more…

By Paul, 4 years4 years ago
Notes

Better file handling in CL with the CLOSE command

CL is an often undervalued part of the i developer’s toolkit, and one that IBM have been quietly enhancing over the years. It does have some quirks however, the most annoying being that if you are reading a file, once you reach the end of the file there is no Read more…

By Paul, 4 years4 years ago
Notes

Better impact analysis with DSPPGMREF

The IBM i Control Language (CL) provides such a rich set of commands that even after almost 30 years, I can still discover something really useful. DSPPGMREF is a case in point: The Display Program References (DSPPGMREF) command provides a list of the system objects referred to by the specified Read more…

By Paul, 5 years5 years ago
Notes

Using CPYSPLF to extract spool files via the IFS

I am currently without iSeries Navigator (or IACS, for that matter). I have a 5250 emulator, of course, but nothing else, which makes for an interesting challenge when I want to email a spool file to someone. Fortunately, there’s CPYSPLF: The Copy Spooled File (CPYSPLF) command copies the data records Read more…

By Paul, 5 years5 years ago
Notes

Adding variables to ad-hoc SQL queries with CL

Last month I mentioned using REXX to build and execute ad-hoc SQL queries. For the sake of completeness, here is the same solution implemented in CL using the RUNSQL command. The program does exactly the same as the previously describe REXX script — extracts all records flagged with today’s date Read more…

By Paul, 5 years5 years ago
Notes

Using RGZPFM to sort physical files

It’s rare that you need to sort a database file (or table), but I have encountered a circumstance in which a sorted file had to be delivered. Being naturally lazy, I started looking around for the least-work method of achieving this and ended up looking at the RGZPFM command. This Read more…

By Paul, 5 years5 years ago
Notes

Using Qshell and CL to work with Stream files in the IFS

It turns out that there is no simple way of generating a list of files currently residing in a folder on the IBM i IFS. Simple, in this case, would be a command like DSPLNK OUTPUT(*FILE). An API does exist, but it turns out that the same results can be Read more…

By Paul, 5 years5 years ago
Search
Categories
  • Announcements
  • News
  • Notes
  • Uncategorised
Tags
%bif API CL CPYSPLF Data Queues Documentation IFS INSTR LOCATE_IN_STRING QMHQRDQD QShell QSYRUSRI Regular Expressions REXX RPG SQL Vim

Find me on LinkedIn


Hestia | Developed by ThemeIsle