4/9/2021 0 Comments Save Spool Files In As400
Copying data from a spool file to a data file with separate fields is not an efficient way to get data.If you are considering using this method for capturing system information, spool files, active job info, etc, then you should be using the Views, Tables, etc that IBM has been creating for us to use.You can search this web site to see if I have written about getting to the information you desire using SQL.
![]() If I was doing this in the real world I would using the SQL and the method described in Output queue entries information via SQL. You will need to work it out before you start writing your programs. Let me start with the definitions, including the data structure. I never use a OVRDBF for files in QTEMP as I can use the External Name keyword, EXTNAME to inform the program where the file will be. When I have a flat file created in this way: File name Record format name Field name. Therefore, I need to rename the record format, using RENAME, and prefix the field name. I have called the data structures subfields the same as the fields in the output file so I dont have to move from one to another field. The exceptions are the two numeric fields, PagesChar and CopiesChar, and the date field, CreateDateChar. In this spool file it is that position 46, part of the number of pages column, must be numeric. If this position is not numeric it is some other line that I do not care about, so I ITER on line 22, to get the next record. I am doing the conversion within a Monitor group because if there is an error during the conversion the ON-ERROR will handle it. On line 26 I am first translating, XLATE, any commas (, ) there may be in the field, as the next step will error if there are commas in the number. The DECH built in function converts the result of the XLATE into a number, and moving it to the output field. If this statement errors then the line after the ON-ERROR, line 27, is executed. This allows me to identify the lines where there was an error. If your IBM i uses a different date format this will be different for you. If the date is invalid I move LOVAL, 0001-01-01, to the date field. If it is valid I use the DATE built in function to convert the contents into a true date value. Save Spool Files In As400 Free Does NotWhat is your approach to get the RPG to compile seeing as to that SPLFILE doesnt exist Create it, compile it, delete it How will someone else recompile this if this is a production program These were the types of situations where, dare I say it, program described files came in handy, but RPG-free does not support those anymore. Dont cringe Jon, read on;) Like it or not, flatfiles are used for all kinds of purposes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |