Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Write the SAR data into two files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Write the SAR data into two files.
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

Site Director


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

PostPosted: Wed Oct 19, 2011 3:19 am    Post subject:
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 Moderator


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

PostPosted: Wed Oct 19, 2011 4:27 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us