CL for Backup Alerts

345 pts.
Tags:
AS/400
AS/400 Control Language
CL programming
Job Control Language
Hi,

I have to set up alert at a specific time on AS400 which will check if the backup job is running.

If the backup is not running at that specific time,it should send an alert'Backup Not Running' else it should send an alert'Backup is running'/'Backup is in Message Wait'.

Can anyone please suggest me a CL which will check this.I am new to CL and I have been unable to put the above logic.

I have an idea where we need to run WRKJOB <Backup Job Name> and then trap the status of the job ie.whether ACTIVE/MSGW or NOT FOUND .But unfortunately I have been unable to code this logic.

Please can anyone help me with this.

Many Thanks

 



Software/Hardware used:
Control Language

Answer Wiki

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

Discuss This Question: 21  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
  • TomLiotta
    First, can you describe your backup procedure? In particular, is this a job that was written in house or is it the one of either the standard or BRMS backup procedures? If you can say more about it, the better an answer can be. Next, you need to be clear in understanding job names. Anyone can run a job with any name at any time. Just because a job with a name of, say, BACKUP is running, it's not a guarantee that it is "the" BACKUP. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Thanks Tom for your answer. The Backup Job name is DAILYBACKUP and is a control group in BRMS.It is excuted thru job scheduler. I am looking for setting up a CL program which will run between 9:30 AM to 9:40AM and check if this backup job DAILYBACKUP is active or not.In case it is not running or in MSGW,the CL should send an alert email specifying that Backup is Inactive or in MSGW.. Please let me know if you need more information Thanks Hughes
    345 pointsBadges:
    report
  • TomLiotta
    Hughes: It'd be easier if it was an in-house program that was doing the backup because you could make a trivial change to it to help identify the job. It's not really needed, but would be nice.(Does BRMS have exit points where user-written routines can be called?) You might have no choice but to assume that any job named DAILYBACKUP will be the daily backup job that you want. It's not a serious issue, but it should be kept in mind that there is the open possibility that you will be looking at the status of the wrong job. BTW, it can't actually be named "DAILYBACKUP" since that is an 11-character name. Do you need to run a program at a point in time between 9:30 and 9:40? Or do you need to run a program that starts at 9:30 and continues running either until 9:40 or until a job named DAILYBACKUP is found to be active? (Your program could start at 9:30 and run for a second; and DAILYBACKUP could start at 9:31.) What if DAILYBACKUP finishes successfully at 9:29? (Changes in strategies can have major impacts on backup timings.) What if a system problem blocks DAILYBACKUP from running? How are you expecting your program to run if IBM jobs can't run? How do you know e-mail will be working under those circumstances? I'm not trying to be difficult. These are just things that might make a difference in the answers. The basic question you asked is fairly easy for me. It might not help you, though, if it simply doesn't work when you need it. Assuming the job name is "DAILYBCKUP", the basic sequence would be:
    • Create a user space.
    • Call the List Job (QUSLJOB) API to list all *ACTIVE jobs named "DAILYBCKUP*ALL *ALL ".
    • If none are listed, then send your alert.
    • If one is listed, extract the fully-qualified job name and call the Retrieve Job Status (QWCRJBST) API to see the status.
    • If status indicates a need, then send your alert.
    None of it needs to be done in CL. It can be done in RPG, COBOL, C, probably even REXX. CL possibly makes some parts a little easier. It would mostly depend on what you're familiar with and what APIs you've called in the past. Your i5/OS version/release might make some difference. The APIs in this task are some of the easiest ones. They're also some of the most widely used. Once a couple of them are understood, most other APIs suddenly start to make sense. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    My apologies... I just realized you needed "status" like MSGW; i.e., you need 'Active Job Status'. The Retrieve Job Information (QUSRJOBI) API would be appropriate, rather than QWCRJBST. Don't hesitate to continue the discussion, even if it's just for clarification on where stuff is documented. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Thanks Tom for your suggestion. I am working on the solution suggested by you. Meanwhile,I have come across a piece of code which may be simple.Can you please help me here. The command WRKACTJOB output(*PRINT) SBS(QCTL)gives me the listing of jobs which run in subsystem QCTL along with their status.They are stored in file QPDSPAJB produced as output of above command. The Backup job which I am targetting also runs in QCTL subsystem.The Backup Job name is DAILYBKUP and it is the only job on the system which runs with that name.It takes 4 hours to complete.At this point of time I need to check at 9:40 AM if the backup job is indeed running. If I run the abpove WRKACTJOB command when the backup job is running and then copy the contents of the file QPDSPAJB to a database file,can I trap the STATUS field based on JOB NAME and then check it out for MSGW or ACTIVE state? If yes,can you please let me know how I can copy the contents of QPDSPAJB properly to database file and then check out for the STATUS of the job.I am stuck up at this point as I am unable to copy the contents of QPDSPAJB properly to database file and then check the STATUS field. Request you to please guide me thru. Many Thanks Hughes
    345 pointsBadges:
    report
  • TomLiotta
    Hughes: It's not a good approach, but I can understand why you would do it. After running WRKACTJOB *PRINT, test these commands in the same job:
    CRTPF FILE(QTEMP/PRTWRKACT) RCDLEN(132)
    CPYSPLF FILE(QPDSPAJB) TOFILE(QTEMP/PRTWRKACT)
    You can use RUNQRY *n QTEMP/PRTWRKACT to view the resulting content in the temporary file. You could use SBS(QINTER) as a test and use any job name in QINTER to see what that job's status is. You just read each record until one matches the job name that you're looking for. Then check the positions at the far right of that record to see if the status is whatever you're checking for. Be aware that this method is not guaranteed to work at any time in the future. The spooled output from WRKACTJOB can (and does) change from time to time. Specify all of the parms for WRKACTJOB; don't rely on any of the defaults. That's about the best I can offer if that's the technique you want to use. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, Thank you for your inputs.I am working on Report Parsing method currently.The backup job name ,the sbs in which it runs and the profile thru which it runs is already known. I am not very good in programming (and using API)and hence I chose this method which I found easy to understand and code. I actually just need to know if the job is ACTIVE or in MSGW or not running. I run the following command and produce the oiutfile: WRKSBSJOB SBS(QCTL) USER(LIVEPROD) OUTPUT(*PRINT) Then I copy the spool file QPDSPSBJ thru CPYSPLF to a file named message20 of standard length 132 as suggested by you: CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) On viewing the file message20,the report is as shown: Line ....+....1....+....2....+....3....+....4....+....5 .. MESSAGE20 000001 5722SS1 V5R4M0 060210 Work with 000002 000003 Subsystem . . . . . . . . . : QCTL 000004 000005 Job Name User Number Type ----Status 000006 MOVMEDBRM LIVEPROD 374971 BATCH MSGW As you can see,the JOBNAME/USERPROFILE/STATUS field can be seen in file Mesage20. The job name starts at position 4 in the Message20 file and is 9 Charachetr long.The User starts at position 17 and is 8 charachetr long.The Status starts at position 49 and is 4 charachter long. I am stuck up at CL program and my doubt is that I am not parsing the Job Name /User and Status field correctly or not reading the file correctly. . My CL is as follows: PGM DCLF FILE(TEST/MESSAGE20) DCL VAR(&MESSAGE20) TYPE(*CHAR) LEN(132) DCL VAR(&JOB) TYPE(*CHAR) LEN(9) DCL VAR(&STATUS) TYPE(*CHAR) LEN(4) DCL VAR(&USER) TYPE(*CHAR) LEN(8) WRKSBSJOB SBS(QCTL) USER(LIVEPROD) OUTPUT(*PRINT) * /*Copy output of QPDSPSBJ to Message20 file*/ * CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) * /*Retreive STATUS/USER PROFILE/JOB NAME from Message20 file*/ CHGVAR VAR(&STATUS) VALUE(%SST(&MESSAGE20 49 4)) CHGVAR VAR(&USER) VALUE(%SST(&MESSAGE20 17 8)) CHGVAR VAR(&JOB) VALUE(%SST(&MESSAGE20 4 9)) /*Pls advice if the above parsing is correct*/ * /*Send the message based on Job Name and Status*/ * IF COND(&JOB *EQ 'MOVMEDBRM') THEN(DO) IF COND(&STATUS *EQ 'MSGW') THEN(DO) SNDDST TYPE(*LMSG) TOUSRID((HUGHES SYS01)) + TOINTNET((hughes10in@gmail.com)) DSTD('MOVMEDBRM is in MSGW') MONMSG MSGID(CPF0000) ENDDO ENDDO DLTSPLF(QPDSPSBJ) CLRPFM(test/message20) ENDPGM I checked the subsystem and the job MOVMEDBRM is stikll in message wait but I did not receive the message for MSGW. Where am I making the mistake?Do I need to put some extra code for reading the file or paring the report Kindly advice where I am wrong. Hughes
    345 pointsBadges:
    report
  • TomLiotta
    Where am I making the mistake? You're not reading any of the records from the file. You need to issue a RCVF command to receive a record from the file before you can test any values in the record. After your IF tests, if you don't find the job name that you want, you have to loop back to receive the next record. Eventually, you will either find a record for your target job or you will reach end-of-file (EOF). EOF will be signalled by message CPF0864 from RCVF. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, We have written this piece of code,but unfortunatlely this is not working.Can you please let us know where were wrong: PGM DCLF FILE(TEST/MESSAGE20) DCL VAR(&MESSAGE20) TYPE(*CHAR) LEN(132) DCL VAR(&JOB) TYPE(*CHAR) LEN(10) DCL VAR(&STATUS) TYPE(*CHAR) LEN(4) DCL VAR(&USER) TYPE(*CHAR) LEN(10) DCL VAR(&EXITLOOP) TYPE(*CHAR) LEN(3) VALUE('NO') WRKSBSJOB SBS(QCTL) USER(LIVEPROD) OUTPUT(*PRINT) /*COPY OUTPUT OF QPDSPSBJ TO MESSAGE20 FILE*/ CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) DOUNTIL COND(&EXITLOOP *EQ 'YES') RCVF MONMSG MSGID(CPF0864) EXEC(LEAVE) /*RETREIVE STATUS/USER PROFILE/JOB NAME FROM MESSAGE20 FILE*/ CHGVAR VAR(&STATUS) VALUE(%SST(&MESSAGE20 49 4)) CHGVAR VAR(&USER) VALUE(%SST(&MESSAGE20 17 10)) CHGVAR VAR(&JOB) VALUE(%SST(&MESSAGE20 4 10)) /*SEND THE MESSAGE BASED ON JOB NAME AND STATUS*/ IF COND(&JOB *EQ 'MOVMEDBRM') THEN(DO) IF COND(&STATUS *EQ 'MSGW') THEN(DO) SNDDST TYPE(*LMSG) TOUSRID((RBS AS01)) + TOINTNET((rbs.wil@domain.com))+ DSTD('MOVMEDBRM IS IN MSGW') + MSG('MOVMEDBRM is in MSGW') + MONMSG MSGID(CPF0000) ENDDO ENDDO ENDDO /*DLTOVR FILE(MESSAGE20) LVL(*)*/ DLTSPLF FILE(QPDSPSBJ) CLRPFM FILE(TEST/MESSAGE20) ENDPGM Many Thanks for your help
    345 pointsBadges:
    report
  • TomLiotta
    ...unfortunatlely this is not working. Why not? What happens? If you get errors, what are they? Where and when do you see them? Do you see errors when you enter source, when you compile or when you run? (Be sure to include any message identifiers if you report any messages.) I can't run the program successfully because it uses values that only exist on your system, so I can't be certain what would happen. You have to tell me. I can tell from looking that the program shouldn't compile. It shouldn't even get past a source editor. This piece, for example:
    SNDDST TYPE(*LMSG) TOUSRID((RBS AS01)) +
       TOINTNET((rbs.wil@domain.com))+
       DSTD(’MOVMEDBRM IS IN MSGW’) +
       MSG(’MOVMEDBRM is in MSGW’) +
       MONMSG MSGID(CPF0000)
    You have a continuation character in front of the MONMSG command. A source editor should flag that as an error when you try to enter that as a source statement. Also, you specified TYPE(*LMSG) but you didn't supply any LONGMSG() text. You supplied a MSG() parameter instead. Of course, if you want to send to an internet e-mail address, you shouldn't be using SNDDST. But it will work in most circumstances. The most likely times for it not to work are when the system is having problems Other than those, it looks okay. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, Thanks again for your suggestion.I have modified the program but when I run it the program just completes without any error code or email alert. I am pasting the modified program and joblog agin for your refrence : PGM DCLF FILE(TEST/MESSAGE20) DCL VAR(&MESSAGE20) TYPE(*CHAR) LEN(132) DCL VAR(&JOB) TYPE(*CHAR) LEN(10) DCL VAR(&STATUS) TYPE(*CHAR) LEN(4) DCL VAR(&USER) TYPE(*CHAR) LEN(10) DCL VAR(&EXITLOOP) TYPE(*CHAR) LEN(3) VALUE('NO') WRKSBSJOB SBS(QCTL) USER(WINS) OUTPUT(*PRINT) /*COPY OUTPUT OF QPDSPSBJ TO MESSAGE20 FILE*/ CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) OVRDBF FILE(MESSAGE20) TOFILE(TEST/MESSAGE20) OVRSCOPE(*CALLLVL) DOUNTIL COND(&EXITLOOP *EQ 'YES') RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM)) /*RETREIVE STATUS/USER PROFILE/JOB NAME FROM MESSAGE20 FILE*/ CHGVAR VAR(&STATUS) VALUE(%SST(&MESSAGE20 49 4)) CHGVAR VAR(&USER) VALUE(%SST(&MESSAGE20 17 10)) CHGVAR VAR(&JOB) VALUE(%SST(&MESSAGE20 4 10)) /*SEND THE MESSAGE BASED ON JOB NAME AND STATUS*/ IF COND(&JOB *EQ 'RUNDOSSVR') THEN(DO) IF COND(&STATUS *EQ 'MSGW') THEN(DO) SNDDST TYPE(*LMSG) TOUSRID((RBS AS01)) + TOINTNET((hughes.williams@domain.com+ .)) DSTD('RUNDOSSVR IS IN MSGW') + MSG('RUNDDOSSVR is in MSGW') + LONGMSG('RUNDOSSVR is in MSGW') MONMSG MSGID(CPF0000) ENDDO ENDDO ENDDO DLTOVR FILE(MESSAGE20) LVL(*) DLTSPLF FILE(QPDSPSBJ) CLRPFM FILE(TEST/MESSAGE20) ENDPGM:ENDPGM On doing dspjoblog,I see the following looping at RCVF: 800 - WRKSBSJOB SBS(QCTL) USER(WINS) OUTPUT(*PRINT) Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL. 1000 - CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) 10 records copied to file MESSAGE20 in TEST. 1100 - OVRDBF FILE(MESSAGE20) TOFILE(TEST/MESSAGE20) OVRSCOPE(*CALLLVL) 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ 1300 - RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) OPNID(*NONE) /* File name is TEST/MESSAGE20. */ End of file detected for file MESSAGE20 in TEST. - RETURN /* RETURN due to end of CL program */ The program never enters the CHGVAR and 'IF' loop after that even if the job RUNDOSSVR is in MSGW in QCTL.Can you please help me out here. Thanks again for your support
    345 pointsBadges:
    report
  • TomLiotta
    Since I can't see what you have in file MESSAGE20, there isn't much I can say. I might make this change:
    CHGVAR VAR(&JOB) VALUE(%SST(&MESSAGE20 4 10))
    SNDPGMMSG  MSG('Job is <' *CAT &JOB *TCAT '> + 
                 User is <' *CAT &USER *TCAT '> +   
                 Status is <' *CAT &STATUS *TCAT '>') +
                 TOPGMQ(*EXT)                          
    /*SEND THE MESSAGE BASED ON JOB NAME AND STATUS*/
    Use SNDPGMMSG to put something into the joblog to see what is being processed. Verify whether or not the angle-brackets are concatenated directly with the values to ensure that you're not off by one or more bytes to the right or left when you substring. Verify that you're actually reading the records that you think you're reading. As stated at the beginning, I wouldn't process the spooled file in the first place. It's not exactly a big degree of difficulty better than using the APIs. There are actually more areas to understand -- temporary files, file I/O, overrides, and more. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, Here is the content of message20 file: Display Report Report width . . . . . : 132 Position to line . . . . . Shift to column . . . . . . Line ....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. MESSAGE20 000001 5722SS1 V5R4M0 060210 Work with Subsystem Jobs 000002 000003 Subsystem . . . . . . . . . : QCTL 000004 000005 Job Name User Number Type -----Status----- Funct 000006 ABEND WINS 378769 BATCH MSGW PGM-A 000007 FEED_MONTR WINS 378767 BATCH ACTIVE DLY-6 000008 RUNDOSSVR WINS 378771 BATCH ACTIVE PGM-R 000009 XFER_MON WINS 378764 BATCH ACTIVE DLY-6 000010 * * * * * E N D O F L I S T I N G * * * * ****** ******** End of report ******** Bottom F3=Exit F12=Cancel F19=Left F20=Right F21=Split Line positioning number or value not valid. As you can see the job RUNDOSSVR is ACTIVE in line number 8 in the report.On running the below program I do not get the email which I should have got.Is it possible for you to help me here please: PGM DCLF FILE(TEST/MESSAGE20) DCL VAR(&MESSAGE20) TYPE(*CHAR) LEN(132) DCL VAR(&JOB) TYPE(*CHAR) LEN(10) DCL VAR(&STATUS) TYPE(*CHAR) LEN(4) DCL VAR(&USER) TYPE(*CHAR) LEN(10) DCL VAR(&EXITLOOP) TYPE(*CHAR) LEN(3) VALUE('NO') WRKSBSJOB SBS(QCTL) USER(WINS) OUTPUT(*PRINT) /*COPY OUTPUT OF QPDSPSBJ TO MESSAGE20 FILE*/ CPYSPLF FILE(QPDSPSBJ) TOFILE(TEST/MESSAGE20) SPLNBR(*LAST) OVRDBF FILE(MESSAGE20) TOFILE(TEST/MESSAGE20) OVRSCOPE(*CALLLVL) DOUNTIL COND(&EXITLOOP *EQ 'YES') RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM)) /*RETREIVE STATUS/USER PROFILE/JOB NAME FROM MESSAGE20 FILE*/ CHGVAR VAR(&STATUS) VALUE(%SST(&MESSAGE20 49 4)) CHGVAR VAR(&USER) VALUE(%SST(&MESSAGE20 17 10)) CHGVAR VAR(&JOB) VALUE(%SST(&MESSAGE20 4 10)) /*SEND THE MESSAGE BASED ON JOB NAME AND STATUS*/ IF COND(&JOB *EQ 'RUNDOSSVR') THEN(DO) IF COND(&STATUS *EQ 'ACTIVE') THEN(DO) SNDDST TYPE(*LMSG) TOUSRID((RBS AS01)) + TOINTNET((hughes.williams@domain.com+ .com)) DSTD('RUNDOSSVR IS ACTIVE') + MSG('RUNDDOSSVR is ACTIVE') + LONGMSG('RUNDOSSVR is in ACTIVE') MONMSG MSGID(CPF0000) /*GOTO LOOP*/ ENDDO ENDDO ENDDO DLTOVR FILE(MESSAGE20) LVL(*) DLTSPLF FILE(QPDSPSBJ) CLRPFM FILE(TEST/MESSAGE20) ENDPGM:ENDPGM I find this report parsing code very simple to understand but do not know why it is not working.Since you are an expert in this field I would like your help here. I have read about APIs also but since they re complex to write I found this code easy to understand and write. My requirement is just to send an email if the particular backup job named DAILYSAV is not found running in QCTL subsystem.Off course I will tailor the above CL and change the job name to reflect DAILYSAV instead. If you have any other simple piece of code,please let me know. I also have a restriction that I cannot change the BRMS control group and hence I am relying on above C:L which I can run from the job scheduler at specific times Sorry for bothering you again.
    345 pointsBadges:
    report
  • TomLiotta
    Here is the content of message20 file: Unfortunately, you didn't paste it in a way that preserved the formatting. I can't tell what position anything is in. Different systems might have slightly different formatting due to system CCSID differences or possibly other elements. I can't tell if your %SST() functions are getting the right values. The best way to preserve formatting with this editor seems to be with a "code" block. After you paste something in, select the text and click the "code" button. That should keep spacing the same as the original. On running the below program... As near as I can tell, the source that you pasted won't compile. So that couldn't be the program that you were running. Also, how have you determined that the program is reading the file that you put the records into? Have you used STRDBG to verify that the records are what you expect? Or did you insert any code to display the values in your variables to let you know that your program is seeing what you think it's seeing? Far too often we don't check what is going on inside of a program because we're certain we already know what's going on. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, I have sent the contents of message20(as a screenshot) file to your email id :tom.liotta@gmail.com.I was unable to paste it in correct format even after pressing the code button.Si send this as an attachment to your email with Subject as Report I got this id from your website http://zap.to/tl400 Kindly let me know if my program is reading the file correctly or my looping is correct? Thanks again for your help
    345 pointsBadges:
    report
  • Splat
    Is the variable name &MESSAGE20 the field name (sans ampersand) in the TEST/MESSAGE20 file? If so, why do you have it declared (as a field in the file it is included with the declaration of the file).
    7,625 pointsBadges:
    report
  • TomLiotta
    Is the variable name &MESSAGE20 the field name... Most likely, it is the field name. When you run CRTPF xxx RCDLEN(nnn), the file is created with a single-field record format and the single-field is named the same as the file. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    I was unable to paste it in correct format even after pressing the code button. How could you tell? The formatting doesn't take effect until you actually post the message. There is some importance to having it here. There will be others who might read this thread. They will want to see what is being talked about. I wrote this just as a consideration for those who will come later. Tom
    125,585 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, I am pasting the contents of MESSAGE20 file here.:
                                    
    Display Report                                 
                                                 Report width . . . . . :     132  
    Position to line  . . . . .              Shift to column  . . . . . .          
    Line   ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
           MESSAGE20                                                               
    000001  5722SS1 V5R4M0 060210                     Work with Subsystem Jobs     
    000002                                                                         
    000003  Subsystem . . . . . . . . . :   QCTL                                   
    000004                                                                         
    000005    Job Name     User         Number   Type      -----Status-----   Funct
    000006    ABEND        WINS         379928   BATCH     MSGW               PGM-A
    000007    FEED_MONTR   WINS         379927   BATCH     ACTIVE             DLY-6
    000008    RUNDOSSVR    WINS         379929   BATCH     ACTIVE             PGM-R
    000009    XFER_MON     WINS         379926   BATCH     ACTIVE             DLY-6
    000010                           * * * * *  E N D  O F  L I S T I N G  * * * * 
    ****** ********  End of report  ********                                       [/CODE
    
     Please advice if the looping ,the substring and the way the file is being read is correct.i am stuck at this point and I have to complete this work at the earliest.Kindly help.
    345 pointsBadges:
    report
  • Hugheswilliams
    Hi Tom, I am trying to paste the data again.The above data which I have pasted has again been misaligned.
    
                                     
    Display Report                                 
                                                  Report width . . . . . :     132  
     Position to line  . . . . .              Shift to column  . . . . . .          
     Line   ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
            MESSAGE20                                                               
     000001  5722SS1 V5R4M0 060210                     Work with Subsystem Jobs     
     000002                                                                         
     000003  Subsystem . . . . . . . . . :   QCTL                                   
     000004                                                                         
     000005    Job Name     User         Number   Type      -----Status-----   Funct
     000006    ABEND        WINS         379928   BATCH     MSGW               PGM-A
     000007    FEED_MONTR   WINS         379927   BATCH     ACTIVE             DLY-6
     000008    RUNDOSSVR    WINS         379929   BATCH     ACTIVE             PGM-R
     000009    XFER_MON     WINS         379926   BATCH     ACTIVE             DLY-6
     000010                           * * * * *  E N D  O F  L I S T I N G  * * * * 
     ****** ********  End of report  ********                                       
                                                                                    
                                                                                    
                                                                                    
                                                                                    
                                                                                    
                                                                           Bottom   
     F3=Exit      F12=Cancel      F19=Left      F20=Right      F21=Split            
    Do let me know if you need any more information from me.
    345 pointsBadges:
    report
  • TomLiotta
    Do let me know if you need any more information from me. The most important thing to know is if your program is reading the file records that you think it's reading. The program structure looks good enough. And the substringing looks appropriate. Now, is the override appropriate? I can't tell. I'd need some debugging info to know for sure. Logging the variable values in the joblog is one easy way to do that. According to your joblog, the SNDDST is never reached. If the substrings are correct, then the data in the records isn't what you think it is. You have to see what the program sees; not what you expect it to see. Have the program show you what it sees. Tom
    125,585 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