|
View previous topic :: View next topic
|
| Author |
Message |
Bhargav_1058
New User
.jpg)
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Bhargav_1058
New User
.jpg)
Joined: 13 Dec 2008 Posts: 53 Location: New York
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|