CL Program Fails after upgrading to V6R1M0

215 pts.
Tags:
AS/400
CL Program
iSeries V6R1
Spool files
Since last year we have been running a cl program to delete spool files from QEZJOBLOG output queue after taking backup using brms. The spool files are deleted till a specified date which is mentioned by the operator while calling the program. But after upgrading the OS from V5R4M0 to V6R1M0 the programs fails at a certain point.

[strong]Error being : Separators in date are not valid[/strong]

[strong]Command run via CL Program is : CVTDAT DATE(&SPLDT) TOVAR(&SPLD) FROMFMT(*DMY) TOFMT(*YYMD) TOSEP(/)                  [/strong]

[strong] [/strong]



Software/Hardware used:
iSeries 570, V6R1M0

Answer Wiki

Thanks. We'll let you know when a new response is added.

So you copy a SPLF to a DB file.
Then you have a proram the rteadys the DB file and runs a CMD.
You must be parsing the input data to get the values you need for the CMD.
Change the parsing logic.to use the correct character string from the input file

Discuss This Question: 20  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    What is the error message? Have you looked at the lower level message to see what value is inccorrect? If you cannot figure it out then, give us that information so we can help you
    41,370 pointsBadges:
    report
  • CharlieBrowne
    I reread it and see the error message is "Separators in date are not valid: What is the value in the variables and how are they determined?
    41,370 pointsBadges:
    report
  • philpl1jb
    I think that we need to see the value of &SPLDT when it fails. Phil
    49,720 pointsBadges:
    report
  • philpl1jb
    Sorry Charlie - Good thing our responses were the same. Phil
    49,720 pointsBadges:
    report
  • TomLiotta
    I pretty agree with comments so far. I see the message text, but no message identifier is given. That makes it a little difficult since any number of messages might have the same message text yet mean different things. Most likely, the message ID is CPF0551 since CVTDAT can throw that message ID. But that doesn't help much since we don't know what is in the &SPLDT variable. That's the likely source of the error. Possibly the upgrade affected separators in whatever is supplying the value for &SPLDT. Just on principle, I would change TOSEP(/) to be TOSEP('/'). The slash character has syntactic meaning to the CL language, so it should be enclosed in quotes. I don't believe that it makes any difference to the CVTDAT command, but it seldom hurts to be explicit. Please verify the message ID and show us the values that are being processed. From those, it might be necessary to know the source of the values. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Heh... "I pretty much agree with comments so far." That wasn't pretty. Tom
    125,585 pointsBadges:
    report
  • Haaiderali
    While calling the CL Program we are passing 3 Parameters i.e. 1. QUSRSYS (Library containing the outq) 2. QEZJOBLOG (Outq from which spool files are to be deleted) 3. 12/08/11 (Cut - Off Date i.e. spool files will be deleted till 11/08/2011 23:59:59) Below are the values stored in Variables. &DISPLAY_CUTOFF = '12/08/11' &DISPLAY_IN03 = '0' &DISPLAY_LIB = 'QUSRSYS ' &DISPLAY_OUTQ = 'QEZJOBLOG ' &SPLDT = '0:01 IST' 5761SS1 V6R1M0 080215 CL Program Dump S655782B 17/08/11 12:34:48 Page 1 Job name . . . . . . . . : ITTRM51 User name . . . . . . . . : ITHAIDER Job number . . . . . . . : 252287 Program name . . . . . . : DLTOLDSPL3 Library . . . . . . . . . : QGPL Statement . . . . . . . . : 4800 Messages Message Message From To Time ID Sev Type Text Program Inst Program Inst 123156 CPC7301 00 COMP File SPOOLED created in QDDCPF 056D DLTOLDSPL3 002C library QTEMP. 123156 CPC7305 00 COMP Member SPOOLED added to QDDCPFM 005B DLTOLDSPL3 002C file SPOOLED in QTEMP. 123432 CPF3485 00 COMP 75372 records copied to QSPCPYF 0781 DLTOLDSPL3 0033 file SPOOLED in QGPL. 123432 CPF0551 40 ESC Separators in date are QCLCNVDT 01ED DLTOLDSPL3 008C not valid. 123432 CPF9999 40 ESC Function check. CPF0551 QMHUNMSG 0000 DLTOLDSPL3 008C unmonitored by DLTOLDS PL3 at statement 4800, instruction X'008C'. Variables Thanks & Regards, Haaider Ali
    215 pointsBadges:
    report
  • CharlieBrowne
    If you look at the values of the &Cutoff, they changed somewhere along the line. &SPLDT is way off. I'm going to guess that is is all home grown and you are outputimg to a &SPLF and then coping that to a DB and using that as input. When you went to the new release, the spool file layout changed but you did not change your code. Check that out first. If that is not it, run the program in DEBUG and stepo through every command to watch all the values change.
    41,370 pointsBadges:
    report
  • ToddN2000
    Yes I agree with CharlieBrown. If you are reading a file that was created with the command WRKOUTQ to *print, then copying into a DB for processing the parameters you are trying to get with a %SUBST may be in different positions. Take a look at the DB file and verify that the start and length of the substring values are correct.
    9,690 pointsBadges:
    report
  • PGMBOB
    V6 did the size of variable foe SPLNBR change from 4 to 6. That might change positions. Work with Spooled Files by Date WRKSPLF SELECT(*ALL) PERIOD(('11:30:00' '01/12/2005') ('20:00:00' '01/12/2005')) This command allows you to work with all of the spooled files on the system that have a create date and time between 11:30 AM and 8:00 PM on January 12, 2005.
    1,040 pointsBadges:
    report
  • TomLiotta
    This thread is a good example of why it is seldom a good idea to use a spooled file as the basis for program data. The List Spooled Files (QUSLSPL) API can provide better information and is far more reliable across system upgrades. Tom
    125,585 pointsBadges:
    report
  • Haaiderali
    I tried running the program in Debug Mode using STRISDB where the program still fails at Convert Date Command. Below is the Data which is being copied from Spool File to DB File in which there are records starting with '5761SS1' and 'File' because of which wrong data is being saved in &SPLDT Variable i.e. 8:31 IST is being stored in the variable instead of 07/07/11 . Output of DB File How do i remove these entries from the DB File using CL Program.
    215 pointsBadges:
    report
  • Haaiderali
    Output of DB File looks like this when viewed in strsql ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10....+...11....+...12....+...13 SPOOLED 5761SS1 V6R1M0 080215 Work With Output Queue MOSIDDES in QGPL 22/08/11 13:33:49 IST Page 1 File User User Data Status Pages Copies Form Type Pty File Number Job Number Date Time R5101 MOSIDDES B5101 RDY 1 1 *STD 5 1 L2NEWUNITD 464390 07/07/11 11:56:20 R5101 MOSIDDES B5101 RDY 2 1 *STD 5 2 L2NEWUNITD 464390 07/07/11 11:56:20 RH517 MOSIDDES BH517 RDY 1 1 *STD 5 3 L2NEWUNITD 464390 07/07/11 11:56:27 RH517 MOSIDDES BH517 RDY 1 1 *STD 5 4 L2NEWUNITD 464390 07/07/11 11:56:28 R5106 MOSIDDES B5106 RDY 1 1 *STD 5 5 L2NEWUNITD 464390 07/07/11 11:56:32 RH518 MOSIDDES BH518 RDY 1 1 *STD 5 6 L2NEWUNITD 464390 07/07/11 11:56:33 R5101 MOSIDDES B5101 RDY 1 1 *STD 5 1 L2NEWUNITD 464461 07/07/11 11:59:27 R5101 MOSIDDES B5101 RDY 2 1 *STD 5 2 L2NEWUNITD 464461 07/07/11 11:59:27 RH517 MOSIDDES BH517 RDY 1 1 *STD 5 3 L2NEWUNITD 464461 07/07/11 11:59:28 RH517 MOSIDDES BH517 RDY 1 1 *STD 5 4 L2NEWUNITD 464461 07/07/11 11:59:28 R5106 MOSIDDES B5106 RDY 1 1 *STD 5 5 L2NEWUNITD 464461 07/07/11 11:59:30 RH518 MOSIDDES BH518 RDY 1 1 *STD 5 6 L2NEWUNITD 464461 07/07/11 11:59:30 QPDZDTALOG MOSIDDES RDY 1 1 *STD 5 1 BKCTRM027 471643 07/07/11 17:29:43 R5363 MOSIDDES B6687 RDY 1 1 *STD 5 12 L2POLRNWL 476165 07/07/11 18:12:07 R5101 MOSIDDES B5101 RDY 1 1 *STD 5 1 L2NEWUNITD 476171 07/07/11 18:12:20 R5101 MOSIDDES B5101 RDY 2 1 *STD 5 2 L2NEWUNITD 476171 07/07/11 18:12:20 RH517 MOSIDDES BH517 RDY 1 1 *STD 5 3 L2NEWUNITD 476171 07/07/11 18:12:25
    215 pointsBadges:
    report
  • CharlieBrowne
    You also may want to ready up on using the EXPDATE parm on your PRTF You set a value as to how many days to save a SPLF, then when you run DLTEXPSPLF, it will delete SPLF entries in whatever queue they are in if it is past n days.
    41,370 pointsBadges:
    report
  • philpl1jb
    Check the data file .. is the date in the correct column? If not change the physical file layout or the SUBSTR functions in your cl. Since your proram is capturing data from a spool file it will contain lines that are useful and some that aren't useful. Those lines do not need to be removed from the file .. just not processed. If &SPLDT is generally getting the date you want, then you are in good shape There would have been an if statement or statements looping back to the RCVF to avoid the blank lines, heading lines etc. One of these IF's does not find the expeced data and needs to be changed. As already pointed out, today you could simpilfy the program by changing the initial data selection rules to only accept spoolfiles in the required date range. Then you could drop the date conversion entirely. Phil
    49,720 pointsBadges:
    report
  • CharlieBrowne
    Follow up on Philip's comment. DLTEXPSPLF is an IBM command that would eliminate the need for your home grown program. BUT, if you did not want to delete SPLFs across all OUTQs, you could set EXPDATE on you PRTFs and then run your program but only select those entries in QEZJOBLOG that have an expiredate.
    41,370 pointsBadges:
    report
  • WoodEngineer
    Check out IBM's DLTOLDSPLF. Its been around a while but still works well. We run it every night on our 6.1 box. It uses API's and runs pretty fast. Since IBM provides the source you can modify as needed. Here is what our version looks like after a number of modifications.
                          Delete Old Spooled Files (DLTOLDSPLF)                     
                                                                                    
     Type choices, press Enter.                                                     
                                                                                    
     User profile name  . . . . . . .                 Name, *ALL                    
     Output queue . . . . . . . . . .                 Name, *ALL                    
       Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB...       
     Days to retain spool files . . .                 Number                        
     Days to retain QEZJOBLOG . . . .   *RETAINDAYS   Number, *RETAINDAYS           
     Days to retain QEZDEBUG  . . . .   *RETAINDAYS   Number, *RETAINDAYS           
     Days to retain QCHECK  . . . . .   *RETAINDAYS   Number, *RETAINDAYS           
     Skip *HOLD spool files . . . . .   *NO           *YES, *NO                     
     Skip *SAVE spool files . . . . .   *NO           *YES, *NO                     
     Skip fax output queues . . . . .   *YES          *YES, *NO                     
     Exclude output queues  . . . . .                 Name                          
       Library  . . . . . . . . . . .                 Name, *ALL                    
                    + for more values                                               
                                                                                    
                                                                                    
                                                                                    
                                                                             Bottom 
    6,425 pointsBadges:
    report
  • CharlieBrowne
    I'm guessing DLTOLDSPLF is from TAATOOLS or some other freeware site It's not a native OS400 command I did find a link to the source: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fapis%2Fapiexdelsp.htm
    41,370 pointsBadges:
    report
  • TomLiotta
    ...but only select those entries in QEZJOBLOG that have an expiredate. The standard system cleanup options have handled joblogs for many years. No need for expiration dates nor custom programs. Just set the cleanup options through the GO CLEANUP menu. Tom
    125,585 pointsBadges:
    report
  • Haaiderali
    [...] 2. Philpl1jb, CharlieBrowne, and TomLiotta are joined by ToddN2000, PGMBOB, and WoodEngineer on a question about CL Programs failing after upgrading to V6R1M0. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following