View previous topic :: View next topic
|
Author |
Message |
Guru Prasath
New User
Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi,
I am trying the pick the last 2 records from the file. i ended up with the following error message.
ICE126A 2 INCONSISTENT *INREC IFTHEN 0 REFORMATTING FIELD FOUND
ICE751I 0 C5-Q95214 C6-Q95214 C7-BASE C8-Q95214 E7-Q95214
TOOLMSG:
ICE606I 0 DFSORT CALL 0001 FOR SORT FROM IN TO OUTFIL USING CTL1
ICE602I 0 OPERATION RETURN CODE: 16
My record format is VB and LRECL = 2500.
This is the sort field i used in my JCL:
//CTL1CNTL DD *
INREC FIELDS=(5,2504,2505:SEQNUM,8,ZD)
SORT FIELDS=(2505,8,ZD,D)
OUTFIL FNAMES=T1,ENDREC=2
//CTL2CNTL DD *
SORT FIELDS=(2505,8,ZD,A)
OUTFIL FNAMES=OUT,OUTREC=(5,2504)
The same JCL is working fine for me for FB dataset after making necessary changes in the sort fields. But for VB, it is throwing the above error.Help me in solving this? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Probably you need to use VTOF and then insert sequence number at end of record. |
|
Back to top |
|
|
Guru Prasath
New User
Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi Sambhaji,
Could you elaborate it further by an example? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Take a look HERE to see an example of what you need. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
use
SORT FIELDS=COPY
OUTFIL VTOF,OUTREC=(5,196,SEQNUM,8,ZD)
as first cntl
and taking output process further |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi,
From whatever has posted so far i seems the TS wants both his input and output as VB. Hence padding should NOT be done at the end as in the case of FB files.
You can modify your CTLn cards like this to achieve this.
Code: |
//CTL1CNTL DD *
INREC BUILD=(1,4,5:SEQNUM,8,ZD,13:5)
SORT FIELDS=(5,8,ZD,D)
OUTFIL FNAMES=T1,ENDREC=2
//CTL2CNTL DD *
SORT FIELDS=(5,8,ZD,A)
OUTFIL FNAMES=OUT,OUTREC=(1,4,5:13) |
|
|
Back to top |
|
|
Guru Prasath
New User
Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Thanks arcvns,
its worked fine for me.
Actually i also tried the same , from the sort trick PDF. |
|
Back to top |
|
|
Guru Prasath
New User
Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi,
i just noticed that ...My input looks something like below..
Code: |
H________ Header record (1st byte)
I (invoices)
I
I
I
H______Header record
I
I
|
One header has more 1 to N no. of invoices...So is there any way to splitting the record meaningfully? |
|
Back to top |
|
|
Guru Prasath
New User
Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
I have small clue on this...
My trailer record will tell , how many headers records are there in the file.
So i have to split the file from the last...and stop at the given header count.
For ex:
My trailer record say
means 154 header records are there. So if i want to split it into last 50 records means..the file has to read from the backwards and stops at the 50th header...
Am i clear? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I am closing this topic. Please start a new topic and give a complete description of what you're trying to do. Show an example of your input records and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields. Explain the "rules" for getting from input to output. |
|
Back to top |
|
|
|