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

Copy few lines from SYSOUT of 10 million lines from SDSF


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
justjpr

New User


Joined: 03 Nov 2022
Posts: 12
Location: INDIA

PostPosted: Fri Nov 25, 2022 9:03 pm
Reply with quote

I have a job (cancelled) in the spool with a huge number of lines in the job log. SYSOUT has 10 million lines because it has written 20 lines of error message for each input record (the input file also has a million lines) due to some issues. I need to purge this job to clean-up and restore the space in SMS/DASD. I would like to copy the first 500 lines and the last 500 lines of SYSOUT into a dataset, before I purge this job. How do I copy it?

We have SORT/ICETOOL to extract a few records if the source is in PDS or PS. The source data is in spool here. I can do screen copy if 20–100 lines are needed. coping 1000 lines using F7/F8 is a cumbersome work.

Any help, is highly appreciated. I need to finish it by the weekend. Monday morning (28-Nov-2022) I need to purge it.

Code:
PREFIX=MYJOB1*  DEST=(ALL)  OWNER=*  SYSNAME=
NP   DDNAME   StepName ProcStep DSID Owner    C Dest               Rec-Cnt Page
     JESMSGLG JES2                 2 MYID001  V LOCAL                  10M
     JESJCL   JES2                 3 MYID001  V LOCAL                   85
     JESYSMSG JES2                 4 MYID001  V LOCAL                   7M
     SYSOUT   STEP001            103 MYID001  V LOCAL                  10M
     A000000J STEP001            106 MYID001  V LOCAL                   15
     VIOSTAT1 STEP001            107 MYID001  V LOCAL                  423
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Fri Nov 25, 2022 9:21 pm
Reply with quote

justjpr wrote:
I can do screen copy if 20–100 lines are needed. coping 1000 lines using F7/F8 is a cumbersome work.


Options to copy from SYSOUT

1. Try to view it using SE inline command from SDSF menu. If it works, copy the first 500 lines using:
- C500 as inline command at the first output line, and
- CUT F500 as operation in the Command line
Then goto BOTTOM of your output, make a note the last line number, subtract 500, and use operation L(ocate) {line} at Command line. Next enter:
- C500 as inline command at the first row on the screen,
- CUT L500 as operation in the Command line

Now you can copy your lines to any other place using operations PASTE F500, and PASTE L500 into another dataset.

2. If SE doesn't work for your 10M lines, try to replace SYSOUT=* to DSN=YOUR.TEMP.OUTPUT with DSNTYPE=HUGE (or whatever is defined by your sysadmin)
Back to top
View user's profile Send private message
justjpr

New User


Joined: 03 Nov 2022
Posts: 12
Location: INDIA

PostPosted: Fri Nov 25, 2022 9:43 pm
Reply with quote

I appreciate sergeyken for immediate response with appropriate answers. 

"EDIF ERROR RC=   20" is the error message for the SE command.

This problem has already been escalated because it took up a lot of space, and I can't run it again with a dataset in SYSOUT. 

I'll try to run the same step again with 10 input records. I hope SE / XDC will work in that case.

Code:

SDSF JOB DATA SET DISPLAY - JOB MYJOB001 (JOB01199)     EDIF ERROR RC=   20
COMMAND INPUT ===>                                            SCROLL ===> CSR
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Fri Nov 25, 2022 10:53 pm
Reply with quote

Do you not have a Sysout at your shop which keeps the job logs archived? This is dangerous if you don’t have it.

If you have it then simply move it there and purge this one and you don’t need anything else to do.

XDC should work.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Sat Nov 26, 2022 11:18 am
Reply with quote

sergeyken wrote:
2. If SE doesn't work for your 10M lines, try to replace SYSOUT=* to DSN=YOUR.TEMP.OUTPUT with DSNTYPE=HUGE (or whatever is defined by your sysadmin)

It should be DSNTYPE=LARGE, or EXTPREF/EXTREQ. With that you can XDC the output as proposed by Rohit.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Nov 26, 2022 5:55 pm
Reply with quote

You can do it using the REXX/API interface. The following shows 50 lines from the front (head) and 50 lines from the back (tail).
Somewhat crude I'll admit and could use some rework, but it works. You can run it in batch, if you are still able to run jobs.
Code:
 /*  REXX  */                                                           
 numeric digits 16                                                       
 rc=isfcalls('ON')                                                       
 Address SDSF                                                           
 isfprefix     = 'RXGV074'  /* jobname */                               
 isffiltermode = 'AND'                                                   
 isffilter     = 'jobid EQ JOB04698'                                     
 sdsid         = 102                                                     
 recn          = 50         /* number of lines in head and tail */     
 "ISFEXEC  ST"                                                           
 if rc<>0 then exit isferr('Initial ST')+8                               
 jtoken=token.1                                                         
                                                                         
 "ISFACT ST TOKEN('"jtoken"') PARM(NP ?) (prefix @)"                     
 if rc<>0 then exit isferr('ISFACT ST NP ?')+8                           
 "ISFACT ST TOKEN('"jtoken"') PARM(NP SA)"                               
 if rc<>0 then exit isferr('ISFACT ST NP SA')+8                         
 say 'Job' jname.1 jobid.1 'has' value(isfdsname".0") 'files'           
 do  dn=1 to isfdsname.0   /* do over dsnames */                         
   /* isfdsname i.e. XX.RXGV074.JOB04698.D0000105.? */                   
   parse var isfdsname.dn .'.'.'.'.'.'dsid'.'.                           
   dsid=substr(dsid,2)+0                                                 
   if dsid<>sdsid then iterate                                           
   filerecn=@reccnt.dn                                                   
   say 'DDname' isfddname.dn 'has' filerecn 'records'                   
   /* now pull data from file */                                         
   address TSO "execio" recn "diskr" isfddname.dn "(stem line.)"         
   if rc<>0 then exit xmsg('read 1 failed rc' rc)                       
   rn=line.0                                                             
   /* show head */                                                       
   say ''                                                               
   do n=1 to line.0                                                     
     say '(head)' strip(line.n,'t')                                     
   end                                                                   
   /* show trail */                                                     
   say ''                                                               
   address TSO "execio" filerecn-(recn*2)-1 "diskr" isfddname.dn "(skip)"
   if rc<>0 then exit xmsg('read 2 failed rc' rc)                       
   address TSO "execio * diskr" isfddname.dn "(stem line. finis)"       
   if rc<>0 then exit xmsg('read 3 failed rc' rc)                       
   do n=1 to line.0                                                     
     say '(tail)' strip(line.n,'t')                                     
   end                                                                   
 end                                                                     
 rc=isfcalls( OFF )                                                     
 exit xmsg()+xmsg('Done...')                                             
                                                                         
XMsg: say arg(1);return 0                       
                       
IsfErr:                                         
 say 'IsfErr' arg(1)                             
 if isfmsg<>""  then  Say  "isfmsg  is:"  isfmsg
 do jn=1  to isfmsg2.0                           
   Say  "isfmsg2."jn  "is:"  isfmsg2.1           
 end                                             

return 0
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
Search our Forums:

Back to Top