|
View previous topic :: View next topic
|
| Author |
Message |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Guys,
I have below requirement
Input
| Code: |
107/02/2013 02:37:10 CA View Output Archival and Viewing (11
SARBCT Batch Processing Utility - Sysout Arch
0ID Jobname Jobid Gen Seq Arc Date Arc T
-------------------------------- -------- -------- ----- ----- ---------- -----
0DMP901BT DMP901BT JOB14090 2240 1 07/03/2013 23:47
DMP901BT DMP901BT JOB58695 2239 1 06/28/2013 23:50
0DMP901BT DMP901BT JOB49624 2181 1 05/02/2013 03:56
0DMP901BT DMP901BT JOB49624 2181 1 05/02/2013 03:56 |
I need to pickup the record having 0DMP901BT and the date as current date or current date-1
For example in above input My sort step should pick the first record since it is having 0DMP901BT and have current date .. I only need first record satisfying my condition and leave rest.
I was thinking of sort card soemthing like below but I am not sure how I would compare the date portion of it which starts from 65th column and is of 10 digit.. Challange for me is to compare the date which is having "/" as saperator
| Code: |
SORT FIELDS=COPY
INCLUDE COND=(1,9,CH,EQ,C'0DMP901BT',AND,65,10,CH,EQ,&DATE ,OR,
65,10,CH,EQ,&DATE-1) |
My Desired output from above input is
| Code: |
| 0DMP901BT DMP901BT JOB14090 2240 1 07/03/2013 23:47 |
|
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
I had some work to do with dates, but using DFSORT rather than SYNCSORT, and the solution was to reformat the dates before processing them.
Do a search in the DFSORT forum, with expat as author and they should be easy enough to find as they were quite recent. It may help you with your problem. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
| Do the overlay of date and then compare to output of &DATE1 |
|
| Back to top |
|
 |
xknight
Active User

Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello,
Sample snippet
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
0DMP901BT DMP901BT JOB14090 2240 1 07/03/2013
0DMP901BT DMP901BT JOB14090 2240 1 07/02/2013
0DMP901BT DMP901BT JOB14090 2240 1 07/01/2013
//SORTOUT DD SYSOUT=*,
// RECFM=FB,LRECL=80
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(101:71,4,105:65,2,107:68,2)
OUTFIL BUILD=(1,80),
INCLUDE=(1,9,CH,EQ,C'0DMP901BT',AND,101,8,CH,EQ,DATE1,OR,
101,8,CH,EQ,DATE1-1)
/ |
Output
| Code: |
********************************* TOP OF DATA **********************************
0DMP901BT DMP901BT JOB14090 2240 1 07/03/2013
0DMP901BT DMP901BT JOB14090 2240 1 07/02/2013
******************************** BOTTOM OF DATA ******************************** |
|
|
| Back to top |
|
 |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
| Thanks a Lot for the solutions!!! |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|