IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Space is not exculded for VBA dataset in SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Khwairakpam Raju Singh

New User


Joined: 05 Dec 2007
Posts: 29
Location: Bangalore

PostPosted: Wed Mar 11, 2009 9:28 pm
Reply with quote

Hi Everyone,
I am facing a problem in SORT program. The input file is VBA format. I have included a condition to omit the records, which have spaces in byte position number 3 to 23. But still I found records in output file, which have spaces in byte number 3 to 23.
I am not able to find any clue to solve this problem.

It will be very kind of you if you give some suggestion to solve this issue.

I have pasted the part of the JCl below:


Code:

//STPCHK3 EXEC PGM=SORT,PARM='VLTESTI=2'           
//SORTMSG DD SYSOUT=*                               
//SORTIN  DD DSN=TZF04CRE.SORT.INPUT,               
//           DISP=SHR                               
//EOS     DD DSN=TZF04CRE.SORT.OUTPUT,             
//           DISP=(,CATLG,DELETE),                 
//           SPACE=(CYL,(10,10),RLSE),             
//           MGMTCLAS=PROD     
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                     
    SORT FIELDS=COPY                               
    OMIT COND=(05,01,CH,EQ,C'1',OR,                 
               07,05,CH,EQ,C'-----',OR,             
               07,20,CH,EQ,C'                    ')
    OUTFIL FNAMES=EOS,                             
    NULLOFL=RC4                                     
    END                                             
/*                                                 
//*       
                                         


Here the input file : TZF04CRE.SORT.INPUT is VBA and it has records which have spaces in bytes 3 to 23.

It will be great if you could suggest me how to omit those records with spaces.

From,
Raju kh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 11, 2009 10:15 pm
Reply with quote

Hello,

You did add 4 for the rdw of the input (it looks like this has been done, but i thought i'd mention it)?

Are you sure the data is actually spaces and not some unprintable value? Have you looked at the data in hex?
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Wed Mar 11, 2009 10:31 pm
Reply with quote

Perhaps the record ends in byte 2 (6 with RDW) so VLTESTI says it fails the test.
Back to top
View user's profile Send private message
Khwairakpam Raju Singh

New User


Joined: 05 Dec 2007
Posts: 29
Location: Bangalore

PostPosted: Wed Mar 11, 2009 10:38 pm
Reply with quote

Yes I do added 4 for RDW.

I have checked the data in hex , it show space only.

e.g: It show following format for record number 2 when I give HEX On. Therefor I can confirm that there is no unprintable value in it.

Code:

000002                                                         
       444444444444444444444444444444444444444444444444444444444
       000000000000000000000000000000000000000000000000000000000
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 11, 2009 11:55 pm
Reply with quote

Hello,

The problem may be because this
Code:
 07,20,CH,EQ,C'                    ')
is comparing a specified length of 20 with a literal that is 21 bytes. . .
Back to top
View user's profile Send private message
Khwairakpam Raju Singh

New User


Joined: 05 Dec 2007
Posts: 29
Location: Bangalore

PostPosted: Thu Mar 12, 2009 2:28 pm
Reply with quote

Hi
I have tried taking other simple example. But still I face same problem.
1) I create 1 dataset with VB formate.
2) I enter three records as follow:
Code:

****** ***************** Top of Data ******************
000001 1                 FIRST RECORD                                 
000002                                                               
000003 3  ITS HAS DATA IN THIS LINE                               
****** **************** Bottom of Data ****************

Here,
1st record: I place 1 in first byte and spaces from 5th position to 10th.
2nd Record: I placed spaces for this record.
3rd record : I place some data in byte posituin 5 to 10.

I got following output in output dataset:

Code:

****** ***************** Top of Data ******************
000001                                                               
000002 3  ITS HAS DATA IN THIS LINE                               
****** **************** Bottom of Data ****************


The first record in input file have same data in the 1 st byte. but it has sapces from byte number 5 to 10. so it got excluded. But for the second records it has only space for whole records but this reord is not excluded in the output file.

The part of JCl which i submit it:
Code:

//STPCHK3 EXEC PGM=SORT,PARM='VLTESTI=2'
//SORTMSG DD SYSOUT=*                   
//SORTIN  DD DSN=RE.TEST.INPUT,DISP=SHR 
//EOS     DD DSN=RF.TEST.OUTPUT,         
//           DSIP=(,CATLG,DELETE),       
//           SPACE=(CYL,(10,10),RLSE),   
//           RECFM=VBA,LRECL=80         
//SYSOUT  DD SYSOUT=*                   
//SYSIN   DD *                           
    SORT FIELDS=COPY                     
    OMIT COND=(09,05,CH,EQ,C'     ')     
    OUTFIL FNAMES=EOS,                   
    NULLOFL=RC4                         
    END                                 
/*                                       
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Thu Mar 12, 2009 6:51 pm
Reply with quote

As I tried to tell you, record 2 is probably short and doesn't actually have "blanks". The variable records have the trailing blanks truncated even though ISPF EDIT displays that way with HEX ON.

Try adding a character on record 2 in position 24. That will actually leave blanks in the bytes between. Now run your sort.

To omit the short, blank lines you'd need to test the RDW in bytes 1-4 for a value of 5 or less (RDW + prtctl char).
Back to top
View user's profile Send private message
Khwairakpam Raju Singh

New User


Joined: 05 Dec 2007
Posts: 29
Location: Bangalore

PostPosted: Thu Mar 12, 2009 11:29 pm
Reply with quote

Hi Bill,
I got your points. Thank you for your help.

When I tried checking for space in 1st byte position ( 5=RWD+1). It actually excluded the records with space.

like:
Code:

OMIT COND=(05,01,CH,EQ,C' ')


But now I am facing another problem as it got impacted in other records which have space in 1st byte (1+4=5) but actually have some data in other byte say from 20 to 30 byte position.

In this case is there any way to handle this issue in sort.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Mar 13, 2009 3:16 pm
Reply with quote

Hello,

Bill was suggesting something like this to omit blank records. Did you try running your latest test with this.
Code:
//SYSIN    DD *         
 OPTION COPY           
 OMIT COND=(1,4,BI,LE,5)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top