Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with Include cond for VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Tue Oct 11, 2011 8:25 am    Post subject: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message

kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Oct 11, 2011 9:21 am    Post subject: Re: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Tue Oct 11, 2011 9:37 am    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Oct 11, 2011 9:47 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Oct 11, 2011 10:41 am    Post subject: Re: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Tue Oct 11, 2011 11:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Oct 11, 2011 11:47 am    Post subject: Re: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Oct 11, 2011 11:50 am    Post subject:
Reply with quote

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
View user's profile Send private message
Parvinder Singh

New User


Joined: 06 Sep 2011
Posts: 6
Location: india

PostPosted: Tue Oct 11, 2011 6:20 pm    Post subject:
Reply with quote

Hi Hemanth, Could you please try without Using OUTREC.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 11, 2011 6:25 pm    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 11, 2011 7:40 pm    Post subject:
Reply with quote

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. . . icon_confused.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Oct 11, 2011 11:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Oct 12, 2011 12:04 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Oct 12, 2011 3:22 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Oct 12, 2011 3:36 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Oct 12, 2011 3:42 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Oct 12, 2011 3:47 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Oct 12, 2011 4:39 am    Post subject: Reply to: Problem with Include cond for VB file
Reply with quote

Thanks enrico, got it now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us