Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Aug 05, 2009 9:35 am Post subject:
nadh,
You can reformat your input with the following control cards. If you need to retain the header and trailer records , is there any thing that would identify them?
Code:
//SYSIN DD *
INCLUDE COND=(1,4,CH,EQ,C'09IN')
SORT FIELDS=COPY
OUTREC BUILD=(C'7808', $ CONSTANT '7808'
05:10,10, $ INPUT 10 BYTE FROM POS 10
15:23,10, $ INPUT 10 BYTE FROM POS 23
25:20,03, $ INPUT 03 BYTE FROM POS 20
30:10X, $ SPACES
40:05,04, $ INPUT 04 BYTE FROM POS 05
44:50,04, $ INPUT 04 BYTE FROM POS 50
48:C'Y', $ CONSTANT 'Y'
49:23,06, $ INPUT 06 BYTE FROM POS 23
55:09,01, $ INPUT 01 BYTE FROM POS 09
56:15,08, $ INPUT 08 BYTE FROM POS 15
70:X) $ SPACES UP TO POS 70
//*
Kolusu Header and Trailer records start with ..................pic.
My another issue is with this "Pos 56-63 in reformatted file should be Pos 15-22 in input trailer record " can we do this.
Kolusu I've tried with the code you provided. Its reformatting both header and trailer as well.
In input dataset Header is starting with low values(hex 0000) and Trailer with high values(hex FFFF). I need to include this header and trailer along with detail records, but detail records should be only '09IN' as stated earlier.
My another issue is with this "Pos 56-63 in reformatted file should be Pos 15-22 in input trailer record " please help me out to do this.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Aug 06, 2009 11:31 am Post subject:
nadh,
You need to show me as to how you need to pick the value from the trailer record. Since the trailer is the last record in your input we need to sort the file or perform another pass to get that value.
Show me a sample of input and desired output
till then here are the control cards which will just reformat the detail records leaving the header and trailer records as is
The code worked fine. Everything is fine But the data in the below control card
56:15,08, $ INPUT 08 BYTE FROM POS 15 needs to be from trailer record starting from 15, 8 characters instead of 15,08 from input file.
Everthing is fine but the data 30003003 (56-63) which is 8 char is taken from 15-22 from input file. But the desired one is it should be 20090327 (from 15-22 in Trailer Record).
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Aug 06, 2009 1:50 pm Post subject:
nadh,
You have been on this site for a long time and yet you cannot clearly define the requirements.
1. The sample input and output does NOT match. The no: of matching records including the header and trailer record are only 7 ( 5 for 09IN records 1 header and 1 trailer ) Your output shows more records. Where did the extra records come from?
2. The Date you want to pick is also same on the header record, cant you use that? If it is the same date , you can avoid a sort operation and get away with COPY
Assuming you canNOT use the header record value and the output will only have 09in records with header and trailer , the following control cards will give you the desired results
I've tried with the code it is giving WER268A OUTREC STATEMENT : SYNTAX ERROR message. Syncsort version is SYNCSORT FOR Z/OS 1.3.1.0R. It is giving the error at this location
As per requirement the date should be picked from Trailer record. I believe the above code you mentioned is for the same. Please give me the sort control cards If client accepts for picking date from header for positon - Pos 56-63 in reformatted file should be Pos 15-22 in input trailer record.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Aug 06, 2009 2:48 pm Post subject:
nadh wrote:
Kolusu,
I've tried with the code it is giving WER268A OUTREC STATEMENT : SYNTAX ERROR message. Syncsort version is SYNCSORT FOR Z/OS 1.3.1.0R. It is giving the error at this location
Please give me the sort control cards If client accepts for picking date from header for positon - Pos 56-63 in reformatted file should be Pos 15-22 in input trailer record.
nadh,
Your Error messages indicate you are using syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. _________________ Kolusu
www.linkedin.com/in/kolusu
2. The Date you want to pick is also same on the header record, cant you use that? If it is the same date , you can avoid a sort operation and get away with COPY
Please provide the code assuming Date from Header record.
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