MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 7:07 am Post subject: Sync sort -- field needs to be suppress in output
Input file is a VB file with record length of 32756.
below is the rough layout of the input file ( as the record length is 32756 i am not mentioning the unwanted fields )
<time-stamp> <program-name> <task-no> <cics-region> <identifier> <copybook> <cust-no> <acct-no>
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 INBOUND XYZ12345 123456789 8012345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXX XYZ12345 123456789 8012345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXX XYZ12345 123456789 8012345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 OUTBOUND XYZ12345 123456789 8012346
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXXX XYZ12345 123456789 8012346
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 END TRAN XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 INBOUND XYZ12348 123456780 8012344
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 XXXXXXXX XYZ12348 123456780 8012344
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 OUTBOUND XYZ12348 123456780 8012344
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 XXXXXXXX XYZ12348 123456780 8012344
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 END TRAN XYZ12348 123456780 8012344
desired output :
<task-no> <identifier> <copybook> <time-stamp> <cust-no> <acct-no>
0005346 INBOUND XYZ12345 2007-10-17 05:02:48:XXX 123456789 8012345
0005346 OUTBOUND XYZ12345 2007-10-17 05:02:48:XXX 123456789 8012345
END TRAN XYZ12345 2007-10-17 05:02:48:XXX
0005347 INBOUND XYZ12348 2007-10-17 05:02:48:XXX 123456780 8012344
0005347 OUTBOUND XYZ12348 2007-10-17 05:02:48:XXX 123456780 8012344
END TRAN XYZ12348 2007-10-17 05:02:48:XXX
only the INBOUND , OUTBOUND , END TRAN records need to be extracted ...
when ever there is 'END TRAN' in the identifier field the <task-no> needs to be supressed
how to achieve the desired output using the syncsort??
do we have ' if then ' option in syncsort? if not is there any alternative for the 'if then ' ?
currently my sortcard (but it is not suppressing the <task-no>)
//SYSIN DD *
INCLUDE COND=(322,7,CH,EQ,C'INBOUND',
OR,322,8,CH,EQ,C'OUTBOUND',
OR,322,8,CH,EQ,C'END TRAN')
SORT FIELDS=(210,7,CH,A,5,24,CH,A)
/*
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 7:09 am Post subject:
oops.... please change it to courier new ( font size 10) before reading.
Back to top
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Wed Oct 17, 2007 7:26 am Post subject:
Mahesh,
Try this:
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(322,8,CH,EQ,C'END TRAN')
BUILD=(315:C'END TRAN'))
Last edited by vkphani on Wed Oct 17, 2007 8:06 am; edited 1 time in total
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 7:37 am Post subject:
let me try that phani....will let you know the result
Thanks,
Mahesh
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 7:49 am Post subject:
phani,
I have to suppress the <task-no> field in my output file....pls look at my desired output ...
let me post my sort card
SYSIN DD *
INCLUDE COND=(322,7,CH,EQ,C'INBOUND',
OR,322,8,CH,EQ,C'OUTBOUND',
OR,322,8,CH,EQ,C'END TRAN')
SORT FIELDS=(210,7,CH,A,5,24,CH,A)
OUTREC FIELDS=(1:1,4,5:210,7,13:322,8,22:331,8,31:5,23,55:341,21)
/*
currently it doesnt suppress the <task-no>
task-no field is in the 210 position of the the input file (with 7 characters in size )
thanks,
mahesh
Back to top
krisprems Beginner Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
Posted: Wed Oct 17, 2007 7:58 am Post subject:
mahesh_chv
Consider this sample SORT JOB and build yours as per your requirement
Code: //*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 INBOUND XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXX XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXX XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 OUTBOUND XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 XXXXXXXX XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005346 CRG2A5 END TRAN XYZ12345
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 INBOUND XYZ12348
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 XXXXXXXX XYZ12348
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 OUTBOUND XYZ12348
2007-10-17 05:02:48:XXX ABCDE101 0005347 CRG2A5 XXXXXXXX XYZ12348
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(50,7,CH,EQ,C'INBOUND',
OR,50,8,CH,EQ,C'OUTBOUND',
OR,50,8,CH,EQ,C'END TRAN')
INREC FIELDS=(1:25,7,9:50,9,19:59,8)
OUTREC IFTHEN=(WHEN=(9,9,CH,EQ,C'END TRAN'),OVERLAY=(1:7X))
/*
SORTOUT contains Code: ---+----1----+----2----+----3
ABCDE10 INBOUND XYZ12345
ABCDE10 OUTBOUND XYZ12345
END TRAN XYZ12345
ABCDE10 INBOUND XYZ12348
ABCDE10 OUTBOUND XYZ12348
Note:
1. I am using the INREC because the your o/p record does not contain all the columns from your i/p.
2. Since we are using the INREC you will have to use the new positions in the SORT =Fields...
3. To Suppress i have made the <task-no> as blanks(OVERLAY=(1:7X)).
4. In my example i am not sorting anything so have left it as SORT Fields=Copy. _________________ cHEERs
krisprems
Back to top
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Wed Oct 17, 2007 8:28 am Post subject:
Mahesh,
The above given solution works but you need to change the positions given in INREC fields as per ypur input file fields.
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 9:39 am Post subject:
Phani,
Thanks for the solution... As I am not in office i couldnt test it.
I will test it tomorrow and will let you know the result.
and what about my outrec??
OUTREC FIELDS=(1:1,4,5:210,7,13:322,8,22:331,8,31:5,23,55:341,21)
I need to retain this...
thanks,
Mahesh
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Wed Oct 17, 2007 9:41 am Post subject:
sorry...u have replaced that with inrec right??
Back to top
mahesh_chv Beginner Joined: 04 Aug 2005 Posts: 41 Topics: 16
Posted: Thu Oct 18, 2007 3:38 am Post subject:
I got solution to my problem
Thanks everyone !!
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum