View previous topic :: View next topic
|
Author |
Message |
kvgreddy1
New User
Joined: 30 Mar 2021 Posts: 7 Location: India
|
|
|
|
Hi All
I need help on preparing one report based the input file data in jcl.
Example : I am having the records as below in input file
Input :
Code: |
23-03-2021 job aaaaa is completed at 6:45
20-03-2021 job bbbbb is completed at 7:30
21-02-2021 job ccccc is completed at 8:15
18-03-2021 job ddddd is failed at 7:20
11-03-2021 job eeeee is completed successfully |
Output report should be like this.
Code: |
aaaaa completed successfully
bbbbb completed successfully
ccccc completed successfully
ddddd failed
eeeee completed successfully |
Can any one help me with this ? We have to prepare the output file Based job status in input file .if we see anything completed in input, it should print job name and job status in report
Code tags added |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
kvgreddy1
What is the challenge in here and what have you tried please? |
|
Back to top |
|
|
kvgreddy1
New User
Joined: 30 Mar 2021 Posts: 7 Location: India
|
|
|
|
Hi
I am having the input file as below. Input as 10 lines in below file.
MAINFRAME01
Job started at 6:30 on Sunday
MAINFRAME01
Job started at 6:40 on Monday
MAINFRAME01
Job started at 6:50 on Tuesday
MAINFRAME02
Job started at 7:02 on Monday
MAINFRAME02
Job started at 7:30 on Tuesday
Output file should like below : i need last successful job name and status in single row
Example : MAINFRAME01 ran 3 times in three days.but I want only one last successful transaction in file.it should be like below. MAINFRAME02 also has two record but I need only last record along with that status.
Output file : only two lines should copied in output file
MAINFRAME01 job started at 6:50 on Tuesday
MAINFRAME02 job started at 7:30 on Tuesday
I just need last transaction status for all the files. And each transaction stayed in two record and we need merge into single file like above. Please let me know if there is any chance to execute it. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
Why post in JCL & VSAM when you need a SORT solution?
Use IFTHEN=(WHEN=GROUP.. PUSH and OUTFIL SECTIONS w/ TRAILER3 to achieve what your requirement is.
PS: Datasets are NOT stupid files. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
just take a decision please ...
do You want to deal with completed or started |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Moved to DFSORT unless you tell me you have a SYNCSORT. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2145 Location: USA
|
|
|
|
Code: |
INCLUDE COND=(11,70,SS,EQ,L(C’ completed ‘,C’ failed ‘))
. . .
INREC IFTHEN=(WHEN=(11,70,SS,EQ,C’ completed ‘),
BUILD=(16,5,C’ completed successfully ‘)),
IFTHEN=(WHEN=(11,70,SS,EQ,C’ failed ‘),
BUILD=(16,5,C’ failed ‘))
. . . |
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
As Enrico said please be clear on what you need
The Second updated request has only started
How do you know the job MAINFRAME01 has ended ok? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Easy to understand for you as a beginner but there are always better ways to use as SECTIONS/TRAILER ( As suggested above) or use a RESIZE instead of GROUP and PUSH.
If this is not what you wanted then share us the actual input and expected output since you have told us differently in your original post vs reply.
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD *
MAINFRAME01
JOB STARTED AT 6:30 ON SUNDAY
MAINFRAME01
JOB STARTED AT 6:40 ON MONDAY
MAINFRAME01
JOB STARTED AT 6:50 ON TUESDAY
MAINFRAME02
JOB STARTED AT 7:02 ON MONDAY
MAINFRAME02
JOB STARTED AT 7:30 ON TUESDAY
//TEMP DD DSN=&&TEMP,DISP=(NEW,PASS,),UNIT=SYSDA
//SORTOUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(SORTIN) TO(TEMP) USING(CTL1)
SELECT FROM(TEMP) TO(SORTOUT) LAST ON(1,11,CH)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:1,80,201:SEQ=1))
OUTFIL FNAMES=TEMP,INCLUDE=(201,1,ZD,EQ,2),
BUILD=(81,11,X,1,80) |
Output
Code: |
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
MAINFRAME01 JOB STARTED AT 6:50 ON TUESDAY
MAINFRAME02 JOB STARTED AT 7:30 ON TUESDAY
******************************** BOTTOM OF DATA ******************************** |
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
@Rohit: The TS has not posted ANYTHING yet what he has tried so far. Your solution has two steps where only one is needed, but it looks nice.. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
MAINFRAME01
JOB STARTED AT 6:30 ON SUNDAY
MAINFRAME01
JOB STARTED AT 6:40 ON MONDAY
MAINFRAME01
JOB STARTED AT 6:50 ON TUESDAY
MAINFRAME02
JOB STARTED AT 7:02 ON MONDAY
MAINFRAME02
JOB STARTED AT 7:30 ON TUESDAY
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,EQUALS
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,11,CH,NE,C'JOB STARTED'),PUSH=(40:1,11))
OUTFIL FNAMES=(SORTOUT),REMOVECC,NODETAIL,
SECTIONS=(40,11,TRAILER3=(40,11,X,1,30))
END
/* |
Code: |
****** **************************** Datenanfang **
000001 MAINFRAME01 JOB STARTED AT 6:50 ON TUESDAY
000002 MAINFRAME02 JOB STARTED AT 7:30 ON TUESDAY
****** **************************** Datenende **** |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Joerg.Findeisen wrote: |
@Rohit: The TS has not posted ANYTHING yet what he has tried so far. Your solution has two steps where only one is needed, but it looks nice.. |
Yes Joerg, It has two passes for TS better understanding since he seems to be beginner ( which is okay with me ) . I wouldn’t be surprised if he has not tried anything 😊.Yours is certainly a better solution. |
|
Back to top |
|
|
kvgreddy1
New User
Joined: 30 Mar 2021 Posts: 7 Location: India
|
|
|
|
Hi Rohit,
Thank you for your help. Below code worked for me.
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:1,80,201:SEQ=1))
OUTFIL FNAMES=TEMP,INCLUDE=(201,1,ZD,EQ,2),
BUILD=(81,11,X,1,80) |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
The same code should also work for your other posting to combine two records into one. |
|
Back to top |
|
|
|