IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort card help to prepare status report


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
kvgreddy1

New User


Joined: 30 Mar 2021
Posts: 7
Location: India

PostPosted: Tue Mar 30, 2021 1:13 am
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Tue Mar 30, 2021 1:21 am
Reply with quote

kvgreddy1

What is the challenge in here and what have you tried please?
Back to top
View user's profile Send private message
kvgreddy1

New User


Joined: 30 Mar 2021
Posts: 7
Location: India

PostPosted: Tue Mar 30, 2021 1:30 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 631
Location: Bamberg, Germany

PostPosted: Tue Mar 30, 2021 1:38 am
Reply with quote

Why post in JCL & VSAM when you need a SORT solution? icon_question.gif

Use IFTHEN=(WHEN=GROUP.. PUSH and OUTFIL SECTIONS w/ TRAILER3 to achieve what your requirement is.

PS: Datasets are NOT stupid files. icon_exclaim.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10803
Location: italy

PostPosted: Tue Mar 30, 2021 1:48 am
Reply with quote

just take a decision please ...
do You want to deal with completed or started
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2815
Location: NYC,USA

PostPosted: Tue Mar 30, 2021 1:56 am
Reply with quote

Moved to DFSORT unless you tell me you have a SYNCSORT.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1231

PostPosted: Tue Mar 30, 2021 2:35 am
Reply with quote

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 ‘))
. . .


36_2_18.gif icon_axe.gif 12.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Tue Mar 30, 2021 2:39 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2815
Location: NYC,USA

PostPosted: Tue Mar 30, 2021 2:43 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 631
Location: Bamberg, Germany

PostPosted: Tue Mar 30, 2021 2:57 am
Reply with quote

@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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 631
Location: Bamberg, Germany

PostPosted: Tue Mar 30, 2021 3:40 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2815
Location: NYC,USA

PostPosted: Tue Mar 30, 2021 5:31 am
Reply with quote

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
View user's profile Send private message
kvgreddy1

New User


Joined: 30 Mar 2021
Posts: 7
Location: India

PostPosted: Wed Mar 31, 2021 2:33 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2815
Location: NYC,USA

PostPosted: Wed Mar 31, 2021 3:52 am
Reply with quote

The same code should also work for your other posting to combine two records into one.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To re-format the file using SORT card DFSORT/ICETOOL 7
No new posts File Status Error code 39 when Proces... COBOL Programming 2
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
Search our Forums:

Back to Top