IBM System i

IBM i, formerly known as AS/400, is a proprietary, midrange, object-based operating and application system. It includes a relational database, a menu-driven interface, support for multiple users, block-oriented terminal support and printers, and supports security, communications, and web-based application servers including Websphere, Apache and Tomcat.

Share tech news, updates, or what's on your mind.

Sign up to Post

I could use some help with my script. I put *** where I need help making a code that would auto enter the most recent sundays date. Could you help?

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
   autECLSession.autECLOIA.WaitForAppAvailable
   
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "[tab]"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "158"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "[field+]"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "5"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "[enter]"
   
   autECLSession.autECLPS.WaitForAttrib 10,56,"00","3c",3,10000

   autECLSession.autECLPS.WaitForCursor 10,57,10000

   autECLSession.autECLOIA.WaitForAppAvailable
   
   autECLSession.autECLOIA.WaitForInputReady
   ***Input the most recent sunday's date.
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "[field+]"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "[field+]"
   autECLSession.autECLOIA.WaitForInputReady
   autECLSession.autECLPS.SendKeys "580171"
end sub
0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

I'm trying to install cURL on our IBM I v.7.2 and have downloaded the AIX binary to the IFS root directory using Navigator.  I have run the command CALL QP2TERM which opens the PASE command line, CD to directory :  Mycurl\opt\freeware\bin\   which has listed curl , curl_32 and curl_64.  when I run  'curl' from the command line I get this error:
 > curl                                                                                  
   exec(): 0509-036 Cannot load program curl_64 because of the following errors:        
           0509-150   Dependent module libcurl.a(libcurl.so.4) could not be loaded.      
           0509-022 Cannot load module libcurl.a(libcurl.so.4).                          
           0509-026 System error: A file or directory in the path name does not exist.  

I can not find any simple steps on installing cURL on the IBM I.  Please help, thanks!       I downloaded cURL from:  https://curl.haxx.se/download.html   AIX
0
Convert 8 digit numerical field date in CCYYMMDD format to MMDDCCYY format in free form rpg.

This little trick doesn't seem to work in free format.
*DATE         MULT      10000.0001    XXDATE            8 0


how can i convert 20180501 to 05012018 on one line of code?
0
RPG code to extract first and last name from an "entire name" field.

I have a field that has clients' entire name.   Last name is always first, followed by a space.  I need to get all the characters until a space is found and put those chars into a last name field. Then, grab all the chars after the space and put those in the first name.


NAME
SMITH TED B.
SMITH RANDY
SMITH TOMMY R JR
JONES BRETT

to

LASTNAMEFLD                 FIRSTNAMEFLD
SMITH                                TED B.
SMITH                                RANDY
SMITH                                TOMMY R JR
JONES                                 BRETT
0
Hi Experts,

I have some SQLRPGLE problems with reading a tabel (with null capable fields)
The program reads a record in a DS , change 2 fields and write it to a remote (identical) table.

But I have to add a null "check field" per field
exec sql fetch next from cIMPH INTO
 :DS_REFERENCE       :ISNUL1,          
 :DS_CONTEXT         :ISNUL2,          
 :DS_OBJECT_TYPE     :ISNUL3;

In this example it's not a problem, but I need to do this for a file with round 100 fields.
So I prefer to use the SQL

exec sql fetch next from cIMPH INTO :DS;

On top of that, if I use the null-check field, the original field contains a space or a zero.
the remote table expect null values.

How can I solve this?
0
Hi Experts,

After creating several tables with SQL (because of the naming I have to use), I have in my Data Library files with names as CUST_00001 and PROD_00001 (as expected),
The field names in the files from DB2 site, are numbered CDTA_00001, CDTA_00002 etc.  (also as expected),

I prefer to have the SQL field names in my SQLRPGLE program, so that I can create a readable (maintainable) program, is there a way to manage that?

Thanks
0
We have very large Journal receiver (about 61 Gig) on the system journal QAUDJRN. We will be swapping the receiver and changing it to be managed by the system, but I am wondering how long the CHGJRN command will take with a receiver that is so large.
Does anybody have any experience of changing journal receivers? and know how much time the process usually takes?
0
I am wondering if there is a way to view all the jobs that have ran from a particular JOBQ for the past 24 hours (or the past xx hours)?
0
I have an application AS400/iSeries application that i am using to scan receipts into the warehouse.
The scanner is a Zebra TC20 scanner. (droid based)  I am using the Mochasoft emulation.  Pretty vanilla.

When I scan into a field, I would like the program to advance to the next field to be ready to scan.   I am using the DDS keyword Check(ER) on the fields.  but that doesn't seem to make a difference.  If I scan data that is the exact same size as the field, then it does advance.  But the part# is like 10 long, but I am only scanning 5 characters.  It needs to jump down to the qty, but doesn't.  It will if you press tab on the device.
Any way to make it do this?  this is my program.
SN1000R1 SCAN FOAM RECEIPTS  
                             
EMP#.....:                  
PO/Schdle:                  
Part#....:                  
Qty Recvd:                  
                             
LAST SCANNED:    

Any ideas?
0
Hi Experts,

In a CL I collect information about *.CSV files in a specific IFS map.  /mypath/*.[Cc][Ss][Vv]
The output is redirected to an existing file /QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR

QSH CMD('find /mypath/*.[Cc][Ss][Vv] > /QSYS.LIB/MYLIB.LIB/MYFILE.FILE/MYFILE.MBR')  
On our developementserver it worked fine.

Now we transfered the software to the testenvironment on the production server
find /mypath/*.[Cc][Ss][Vv] > /QSYS.LIB/TESTLIB.LIB/MYFILE.FILE/MYFILE.MBR  
And it still works as expected.

Once we tried it on the Production environment, it stop working, (the  /PRODLIB is located on ASP1).
so I added  /IASP1 to the path,
find /mypath/*.[Cc][Ss][Vv] > /IASP1/QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR  
and still get the error:
qsh: 001-0055 Error found creating file /IASP1/QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR. No such path or directory.
0
Learn SQL Server Core 2016
LVL 12
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I need to get guidance on proper storage of an as400. I believe it is running system 38 (or 36).

Regards, George
0
Hi Expert(s),

Is there a way to write Data (eventually with SQL)  from the AS400-DB2 to a MySQL-DB or Oracle?
0
Hi Experts,

On a Website I found a link to create webservices with a standard tool that is available on the IBMi "/QIBM/ProdData/OS/WebServices/V1/client/bin/wsdl2rpg.sh"
The result is a Service program that contains all required info to call the webservice.

I'm able to fill the WS variables, but I can't find where and how I can add header elements like :
<httpHeader>                          
     <header name="Accept-Encoding" value="gzip,deflate"/>               
     <header name="Api-Key" value="123456"/>   
     <header name="Host" value="api.web123.com "/>        
     <header name="Connection" value="Keep-Alive"/>                 
</httpHeader>   

Open in new window

(of course, the value data is variable)
How can I add these to the WS-header  

Thanks
0
HI All,

I've been trying to figure out why there would be such a difference in doing an Insert Into query to my local iSeries vs my remote iSeries through MS Access.  I have a simple query that has about 3800 rows of data and 4 columns.  There are keyed values in both the table on the iseries and in access.  When I do the Insert Into query to the iSeries in my building, it is super fast, just as quick as doing a file transfer.  When I do the same query to my remote iSeries, it takes super long and appears to do it in junks.  Both ODBC configurations are the same and I'm puzzled as to what is going on.  My current work around is to do a file transfer outside of Access, but I'd really like to just put the data right into the table through Access without opening another table.  

Has anyone dealt with this before?  Any suggestions on things I can try or look at to make the data transfer quicker through Access?
0
IBMi / AS400  Hello Experts, I have a need to pass a URL address to the internet that contains zip codes by radius and return the results.  I have found a pretty good site that I can use to pass this URL address and the results are in a CSV format.   How do I pass the URL and save the results in a DB2 file?
0
Dears,

I have a Qlogic issue in IBM BladeCenter, Blade HS22 and LS42.

as attached picture no  device present in Fiber Channel Device.


Regards,
Saeed
Blade5.jpg
0
Started logon on iSeries with FTP.  for getting:   PF file (character fields) to WIN-PC, as txt-file.

File which arrives at PC is no readable textfile.
What are possible reasons : Codepage, Charakterset ... ?

FTP command:  get  filexxxx.file  filexxx.txt

Result:
㌱〱ㄷ〸㌳㈴吰䥓䅓䕖†儠单䉒䵒†⨠䥆䕌†匠噁⁆††〠⚜寭㼓畱牳牢潦⁲汦獡捨灯⁹敲瑳牯⁥††††††††††〰〱〳ㄵㄸ〰㔹吶䥓䕓⁃†ㄠ㔰㔱㠱〱㌲㈲䅓䱖䉉††萃靮ޕ〰楓⹣䐭瑡楥†††

or

??????????Å????Å???Å???ÅÅ???????????????????ÅÅÅÅÅÅÅÅÅÅ???????????Å??????????ÅÅ?????????ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ??????????ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ?ÅÅÅÅÅÅÅÅÅÅÅ?????????????Å????Å?ÅÅÅÅÅÅÅÅÅÅÅÅ????????Å?????????'ÅÅÅ????ÅÅÅÅÅÅ??ÅÅÅÅÅÅÅÅÅÅÅ???ÅÅ ??ñ

Hello,
thanks a lot for detailed Information about FTP so far.
Problem seems System (LPAR) dependend. I tested on two different LPAR: one was OK, on the other LPAR notOK (see above) with the same FTP (Log below)

OK FTP result:
1010818102824TSISAVE   QUSRBRM   *FILE   SAVF      0_c€à_ qusrbrm for flashcopy restore                     001030518100956

Both LPAR have the same, following definitions:
QSYSVAL QCCSID : 65535  
PF CCSID                : 37

PF field is  :
 (wanted only to get field ODDDAT from QUSRBRM.file,  for Monitoring reasons on WIN-PC. Ignored other fields in the record .. . . . )
ODDDAT     CHAR            6       6         2        Both
      Coded Character Set Identifier  . . . . . :     37      

QUSRBRM.file was created by :
     DSPOBJD OBJ(MYLIB/QUSRBRM) OBJTYPE(*FILE) OUTPUT(*OUTFILE) -
0
HI,

I have a Model 9406-170 with OS: V4R4M0

I can login to this system via FTP and navigate to the AS400 library (MFG.PMS) that I want to download files from. I have verified through green screen that the files PMCR06.PGM and PMCR06CL.PGM exist in this library.

My FTP "pwd" command output:
257 "MFG.PMS" is current library

My FTP "ascii" command output:
200 Representation type is ASCII nonprint.

My FTP "get PMCR06.PGM" OR "get PMCR06" command output:
550 File PMCR06 in library MFG.PMS not found.  
550 File PMCR06.PGM in library MFG.PMS not found.

So I attempted FTP command "dir" and get this output:
200 PORT subcommand request successful.
126 Member *ALL not found in file *ALL in library MFG.PMS.
250 List Completed.

NOTE: I ultimately want to do the following via FTP...
1) Start FTP session.
2) Set FTP session to ASCII.
3) Set FTP session to not prompt.
4) Navigate to an AS400 library.
5) Download all files in the library via FTP command mget *
Repeat starting at step 4.

I'm new to the AS400 but not FTP.  Anyone have any tips?  

Thanks!
0
Hi All

Greetings!!!

Hope you are well.

I need to copy a Schema from one machine to other machine,

Both machines have Db2 instance of same version (10.5)

But Schema is having data of LOB data type.

Which method is simple to copy the entire schema with structure and data.

I know ADMIN_COPY_Schema only supports on same machine and under same instance .

But db2move utility does not support LOB data type (I think).

Any inputs on this Please.

Thanks in Advance!!!!
0
Become a Microsoft Certified Solutions Expert
LVL 12
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

One of our developers is attempting to do an "Insert" into a view.  They are connecting in via ODBC.

I gave the user profile *ALL authority to the View but I am getting the error:

Message: [SQL0551] Not authorized to object VSTOWERINT in DCTEST type *FILE. Cause . . . . . :   An operation was attempted on object VSTOWERINT in DCTEST type *FILE.  This operation cannot be performed without the required authority. Recovery  . . . :   Obtain the required authority from either the security officer, the object owner, or a user that is authorized to the QIBM_DB_SECADM function. If you are not authorized to a logical file, obtain the authority to the based-on files of the logical file. Try the operation again.   Processing ended because the highlighted statement did not complete successfully

I figured I needed to give the user access to the file that the view was based on...but I gave the user *ALL access to this file too and we are still getting the same error.

Does anyone have any insight into why we would be getting this error - even though we gave the user *ALL access?

Thanks in advance
0
Hi, we have two tapes to be used for daily backup. and we have scheduled jobs to run the daily backups at night. previously, we only need 1 tape but now, it asks for 2nd tape. we have a program to initialize single tape, but not for 2 tapes. can anyone helps on how to intialize more than 1 tape  for daily backup   (1 week rotation basis). 2 tape cartridges per day, 14 tapes/week. os version: v6r1. thanks.
      PGM                                                                
      DCL VAR(&DAY) TYPE(*CHAR) LEN(4)                                  
      DCL VAR(&DLYVOL) TYPE(*CHAR) LEN(6)                                
      RTVSYSVAL SYSVAL(QDAYOFWEEK) RTNVAR(&DAY)                          
      CHGVAR VAR(&DLYVOL) VALUE('DLY' *CAT %SST(&DAY 2 3))              
      INZTAP DEV(tapxx) NEWVOL(&DLYVOL) NEWOWNID(xxxx) CHECK(*NO) -
 ENDOPT(*REWIND)                                                        
      ENDPGM
0
Hi experts,

I recently discovered the "SYSTOOLS.HTTPPOSTCLOB" to consume webservices
As long as I give the right input to the WS, it works fine, but I can't figureout how to catch errors.

e.g. I send a wrong ZipCode a Zipcode-service to get an address.
If I do that in SoapUI I get the information:
{"errors": [{
   "status": "400",
   "title": "Bad Request",
   "detail": "postalcode has the wrong format. It should be: 9999XX"
}]}

Open in new window

If i do the same request with SYSTOOLS.HTTPPOSTCLOB, the response is empty (I assume null),
result : GDATA_DATA          CHAR(8000000)        NOT ADDRESSABLE

SQLCODE = -4302
SQLSTATE = '38000'

SQL Diagnostics data:
        ....5...10...15...20...25...30...35...40...45...50...55...60 
   1   'COMMAND_FUNCTION=VALUES INTO;COMMAND_FUNCTION_CODE=-66;DB2_N'
  61   'UMBER_CONNECTIONS=+1;DB2_SQL_ATTR_CONCURRENCY=R;DB2_SQL_ATTR'
 121   '_CURSOR_CAPABILITY=R;DB2_SQL_ATTR_CURSOR_HOLD=N;DB2_SQL_ATTR'
 181   '_CURSOR_ROWSET=N;DB2_SQL_ATTR_CURSOR_SCROLLABLE=N;DB2_SQL_AT'
 241   'TR_CURSOR_SENSITIVITY=S;DB2_SQL_ATTR_CURSOR_TYPE=F;MORE=N;NU'
 301   'MBER=+1;CLASS_ORIGIN=ISO 9075;CONDITION_NUMBER=+1;DB2_MESSAG'
 361   'E_ID=SQL4302;DB2_MESSAGE_ID1=CPF503E;DB2_MODULE_DETECTING_ER'
 421   'ROR=QSQVALUE;DB2_ORDINAL_TOKEN_1=SYSTOOLS.HTTPPOSTCLOB;DB2_O'
 481   'RDINAL_TOKEN_2=HTTPP00013;DB2_ORDINAL_TOKEN_3=java.net.Malfo'
 541   'rmedURLException:no protocol:                               '
 601   '                                  

Open in new window

0
Hi Experts,

We are getting the error message CPF5033 during READ operation in batch program and error message says the below.
"I/O error CPF5033 was detected in file B1PBILH (C G D F)."

When I check the log it says
" Select or omit error on field B1PBILH_1.BTCAR member B1PBILH.  
 Select/omit error on member B1PBILH.                            "

"I/O error CPF5033 was detected in file B1PBILH.                          
Function check. RNX1299 unmonitored by BLR573R1A at statement 0000048100,
  instruction X'0000'.                                                    "

I have checked the record lock and object lock on the file. No locks exist.
I have checked the data for the particular record where to check the junk value. No junk value exist.
And we are getting this error randomly for different records.

Program flow:
Cl program does the OVRDBF and then opnqry on the file and we read the same file in RPGLE with out key.
and we are getting CPF5033 error while performing the read operation on the file.

Please help me to fix the issue. I have attached the screen shot for your reference.


Thanks in advance.

Regards,
Sri
0
While do save/restore operation on *LINK in AS400,I am getting error  "File system error occurred. error number 3474
0
SSH: Trying to send files in binary mode from STRQSH (phase). Is there a command like the FTP command "bin" I have tried the TYPE command but no success. How do we change transfer mode from ascii to binary?
0

Author Comment

by:Per Tore Johansen
Hi Gary. I checked and it should be UTF-8 or 8859-1 so I used the cpytostmf with stmfccsid(1208) or 819. This was actually the problem not if the transmission was i binary or not. Thank you very much for all of your help!
0
LVL 36

Expert Comment

by:Gary Patterson
Excellent.
0

IBM System i

IBM i, formerly known as AS/400, is a proprietary, midrange, object-based operating and application system. It includes a relational database, a menu-driven interface, support for multiple users, block-oriented terminal support and printers, and supports security, communications, and web-based application servers including Websphere, Apache and Tomcat.

Top Experts In
IBM System i
<
Monthly
>