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

Write the SAR data into two files.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Wed Oct 19, 2011 2:59 am
Reply with quote

I want to get the Current & Previous days joblog from SAR page into two separate files.
I have achieved this as below.

1). Get all the GEN from SAR into a flat file.
Code:
/LIST ID=JOBA GEN=*


2). Just get the first 2 GEN from the list produced above using below.
Code:
 SORT FIELDS=COPY,STOPAFT=2                                         
 INCLUDE COND=(2,8,CH,EQ,C'JOBA')                               
 RECORD TYPE=F                                                     
 OUTREC FIELDS=(1:C'/PRINT ID=',11:2,8,19:C',',                     
                20:C'GEN=',24:54,4,28:C',',29:C'DDNAME=OUTFILE',38X)


3). Using the SORTOUT from step2 run a SARBCH to get both the generations data into flat file from SAR>
Code:
/PRINT ID=JOBA,GEN=8502,DDNAME=OUTFILE
/PRINT ID=JOBA,GEN=8500,DDNAME=OUTFILE


using this joblog from SAR is printed into one single file.
Can anyone help me to print the joblog into two different files with different GEN's?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 19, 2011 3:19 am
Reply with quote

Hello,

Suggest you generate a "sequence number" and append this to the genertion of the SAR Print statements. Instead of what is currently generated, generate these:
Code:
/PRINT ID=JOBA,GEN=8502,DDNAME=OUTFIL1
/PRINT ID=JOBA,GEN=8500,DDNAME=OUTFIL2
and use the 2 separate files?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 19, 2011 4:27 am
Reply with quote

Bhargav,

Dick has it right. Use these DFSORT control statements:

Code:

 SORT FIELDS=COPY,STOPAFT=2                                       
 INCLUDE COND=(2,8,CH,EQ,C'JOBA')                                 
 RECORD TYPE=F                                                     
 OUTREC FIELDS=(1:C'/PRINT ID=',11:2,8,19:C',',                   
                20:C'GEN=',24:54,4,28:C',',29:C'DDNAME=OUTFIL',   
                SEQNUM,1,ZD,38X)                                   


That will give you DDNAME=OUTFIL1 and DDNAME=OUTFIL2 for the two /PRINT statements.
Back to top
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Wed Oct 19, 2011 4:41 am
Reply with quote

Hi Dick,

perfect sugestion!! I can generate a sequence number and make use of it...

Frank,

Wow, you are awesome!! With Dick's suggestion I have introduced another step to generate and append the sequence number as below.

Code:
 SORT FIELDS=COPY                   
 INREC OVERLAY=(43:SEQNUM,1,ZD)     
 OUTREC BUILD=(1,80)               


But your solution is simply superb!!! I brain was as clear as mud...
always thinks to introduce new steps rather than finding to apply in the same step....
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top