View previous topic :: View next topic
|
Author |
Message |
hemanthj642
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
Hi,
I have used below sort card to filter a VB file.
Length of the input file is 2030 and RECFMT=VB.
My job successfully completed and but got the empty output file.
Can anyone Please help me resolve this problem.
Code: |
//STEP05 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TESTLZ.TI2.SADF.UNPRCSSD.G0001V00,DISP=SHR
//SORTOUT DD DSN=MJI07.TI2.SADF.UNPRCSSD.SORT1,
// DISP=(NEW,CATLG,DELETE),
// STORCLAS=BASE,MGMTCLAS=STANDARD,
// SPACE=(CYL,(1,10),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,2,EQ,C'HH'),FORMAT=CH
OUTREC BUILD=(1,4,5,2026)
/*
//*
|
Thanks,
Hemanth |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
hemanthj642 wrote: |
Can anyone Please help me resolve this problem.
|
What problem? The file would not have had records which match your criteria. That is the reason your output is empty.
If you know that your input file is having such record, then check the position of your include statement is correct. |
|
Back to top |
|
|
hemanthj642
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
Hi,
I have such data in my input file.
Below is the header record of my input file which is having data 'HH' at first position.
HH2011-10-03 18:28:06 02918 IRISSADF
Thanks, |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Actually 'HH' is at the fifth position - you seem to have forgotten about the the 4 bytes of RDW for VB files. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
OUTREC BUILD=(1,4,5,2026) |
If you have formatted data to include in your posts, please put it inside the Code tags, so that the spacing is preserved.
I think your above card should be like this:
Code: |
OUTREC BUILD=(1,4,5) |
This will include data from position 5 to the end of the current record on your variable-length-record dataset.
However, you have no need of the OUTREC anyway with what you have.
With your existing INCLUDE you should be getting records with
"HH" in position 1, (start position 5 when adjusted for RDW, which you have done).
If you are not seeing them on your output, are you looking at the current dataset? You have NEW,CATLG,DELETE. Is your dataset deleted before specifying as new? |
|
Back to top |
|
|
hemanthj642
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
Hi,
I got to update my header record in the input file.
Since the length of the file is big I couldn't open it in Edit mode and hence I am trying to filter it by using INCLUDE cond.
I have tried all the ways with OUTREC with out OUTREC and the OUTREC BUILD with different ways like OUTREC BUILD=(1,4,5) and OUTREC BUILD=(1,4,5,2026) but couldn't achieve this.
I have tried the same requirement with ICETOOL and ICEMAN but got the same result, job success but o/p file empty.
I have tried STOPAFT to get first record ,my job went fine but when I try to open file, got PACKED DATA ERROR.
I have realized that when I try to edit the o/p file I am getting these probms.
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
//STEP05 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD
HH is here
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,2,EQ,C'HH'),FORMAT=CH |
Can you try running this please? |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Quote: |
I have tried STOPAFT to get first record ,my job went fine but when I try to open file, got PACKED DATA ERROR. |
Did you tried F1 to see what the error is all about.
Provide us the dataset information of your input file by providing 'I' in front of your dataset in 3.4 option. |
|
Back to top |
|
|
Parvinder Singh
New User
Joined: 06 Sep 2011 Posts: 6 Location: india
|
|
|
|
Hi Hemanth, Could you please try without Using OUTREC. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what You see under ISPF browse is not <sometimes> what a non ISPF aware program does
if Your dataset was for some reason saved with ISPF PACK profile option
then accessing it with any other program without unpacking will yield wrong results
under ISPF You see what You expect because ISPF <knows> and unpack things
using one record of an ISPF packed VB file will in most cases result in the error You received |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I got to update my header record in the input file. |
I suspect that what you really need to do is copy the file making whatever modification to the header. . .
You should NOT over-write the input file.
Possibly i misunderstand. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Hemanth,
Sigh. If your input file has RECFM=VB and the first record has:
rrrrHH...
where rrrr is the RDW in positions 1-4 and HH is in positions 5-6, then this DFSORT job will give you one output record in SORTOUT:
Code: |
//STEP05 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TESTLZ.TI2.SADF.UNPRCSSD.G0001V00,DISP=SHR
//SORTOUT DD DSN=MJI07.TI2.SADF.UNPRCSSD.SORT1,
// DISP=(NEW,CATLG,DELETE),
// STORCLAS=BASE,MGMTCLAS=STANDARD,
// SPACE=(CYL,(1,10),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(5,2,EQ,C'HH'),FORMAT=CH
/*
//*
|
If it doesn't, then you need to post your complete JES log here so we can see what you're doing wrong (or what you're not telling us).
If you wanted to copy all of the records but just modify the header record, you could use:
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'HH'),
OVERLAY=(...))
|
What you put in OVERLAY would depend on what you want to modify.
If you explain more clearly what you're trying to do with a good example of input and output, then we could help you more easily. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
have tried STOPAFT to get first record ,my job went fine but when I try to open file, got PACKED DATA ERROR.
I have realized that when I try to edit the o/p file I am getting these probms. |
I just tested and my test confirms my previous analisys
the input dataset was saved under ISPF with pack on amen
created the VB1 dataset
edited with some data
saved it after issuing th ecommand PACK ON
run a sort jcl to copy vb1 to vb2 with STOPAFT=1
and ....
Code: |
DSLIST - Data Sets Matching ENRICO.TEST.V* Packed data error
Command ===> Scroll ===> CSR
Command - Enter "/" to select action Message Volume
-------------------------------------------------------------------------------
ENRICO.TEST.VB1 Browsed STOR02
B ENRICO.TEST.VB2 STOR02
***************************** End of Data Set list **************************** |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Presumably editing the dataset again, putting PACK OFF and saving would fix-up the input file.
enrico, if you remove the STOPAFT do you end up with a good file? If so, does it say PACK ON or is it now an ordinary file?
Hemanth, was the editor used to create your test input (directly or indirectly)? If so, try editing it, putting PACK OFF and saving it and see what happens with the sort step. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
No it will not, the stopaft=1 destroys all the data needed to unpack
Quote: |
enrico, if you remove the STOPAFT do you end up with a good file? If so, does it say PACK ON or is it now an ordinary file? |
it's still packed ( the output is a perfect image of the input )
the pack ON/OFF is internal to ispf and managed according to some <ISPF STAMPING> ,
as far as <standard> I/O the dataset is a normal dataset and treated as such with no concern about the content |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Your VB1 is packed and readable in ISPF.
Your VB2 is packed-ish and not readable in ISPF.
Would VB3, a complete copy of VB1, be packed and readable in ISPF?
EDIT: I'm just wondering out of curiousity. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
sory if my previous post was not clear
INPUT is packed
the full copy is packed
the STOPAFT=1 <thing> is clobbered / unpackable because of the loss of the control information |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Thanks enrico, got it now. |
|
Back to top |
|
|
|