MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VB to multiple FB as per given condition

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Kannan
Beginner


Joined: 13 Mar 2003
Posts: 5
Topics: 2

PostPosted: Thu Mar 13, 2003 11:10 am    Post subject: VB to multiple FB as per given condition Reply with quote

Hi,

I am very sorry if this topic had discussed earlier. I have checked it out with search option, but I did not get what I want.

Here is my question. The content of my VB file looks like,
F0004A001<data content>
F0004A001<data content>
F0005A001<data content>
F0005A002<data content>
This will continue until F0100(All these rec's would not be in sequence)

Now I wanted to the rec's starting with F0004 are all in one file, F0005 in one file and so on. All these files have to be in FB.

I tried with following,
Code:

//STEP01   EXEC $SORT                     --> ONLY SYNCSORT                     
//SORTIN   DD  DSN=MY.INPUT.FILE,      --> vb, recl - 2053(incl RDW)   
//             DISP=SHR                                 
//SORTOF01 DD  DSN=FILE04.OUTPUT.FILE,     
//             UNIT=(,5),SPACE=(1,(20,20),RLSE),AVGREC=M,
//             DATACLAS=SXXXFB,LRECL=256,               
//             DISP=(,CATLG,DELETE)                     
//SORTOF02 DD  DSN=FILE05.OUTPUT.FILE,     
//             UNIT=(,5),SPACE=(1,(20,20),RLSE),AVGREC=M,
//             DATACLAS=SXXXFB,LRECL=89,                 
//             DISP=(,CATLG,DELETE)                     
//SYSIN    DD  *               
SORT   FIELDS=COPY                   
OUTREC FIELDS=(1,2049),CONVERT       
OUTFIL FILES=01,                     
       INCLUDE=(1,5,CH,EQ,C'F0004') 
OUTFIL FILES=02,                     
       INCLUDE=(1,5,CH,EQ,C'F0005') 
END   

Though the RC is '0'. But the required records were not copied. Please help me. Thanks, Kannan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Mar 13, 2003 11:20 am    Post subject: Reply with quote

Kannan,

since the input file is VB your actual field starts in position 5. so on the outrec fields you should use 5 as start position.

change your sysin cards to the following

Code:

 SORT   FIELDS=COPY                   
 OUTREC FIELDS=(5,2049),CONVERT       
 OUTFIL FILES=01,                     
       INCLUDE=(1,5,CH,EQ,C'F0004') 
 OUTFIL FILES=02,                     
       INCLUDE=(1,5,CH,EQ,C'F0005') 
END   


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kannan
Beginner


Joined: 13 Mar 2003
Posts: 5
Topics: 2

PostPosted: Thu Mar 13, 2003 11:58 am    Post subject: Reply with quote

Hi Kolusu,

I have tried and found that it is working. But I have one question. If OUTREC fields are starting from 5 and how come the outer limit is 2049? It should be 2053. Isn't it?

Other thing is, during the copy I do not want the file name(for ex: F0004)to be copied to output file. It has to be ignored. Could you tell me how do I ignore this?

Thanks again, Kannan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Mar 13, 2003 12:38 pm    Post subject: Reply with quote

Kannan,

The first 4 bytes in variable block file is the RDW.so in your case you said that the lrecl is 2053 including rdw , so I subtracted the 4 bytes from it.

For omitting the file name change your sysin cards as follows:
Code:
 
 SORT   FIELDS=COPY                   
 OUTREC FIELDS=(5,2049),CONVERT       
 OUTFIL FILES=01,INCLUDE=(1,5,CH,EQ,C'F0004'),
 OUTREC=(10,2044)
 OUTFIL FILES=02,INCLUDE=(1,5,CH,EQ,C'F0005'),
 OUTREC=(10,2044) 
 END   


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kannan
Beginner


Joined: 13 Mar 2003
Posts: 5
Topics: 2

PostPosted: Thu Mar 13, 2003 1:05 pm    Post subject: Reply with quote

Kolusu,

It is giving syntax error.

WER161B ALTERNATE PARM USED
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

I forgot to tell you one thing that other than the file name, A0001 and A0002 (you can see these values in my input) are also have to be ignored. I tried with

SORT FIELDS=COPY
OUTREC FIELDS=(5,2049),CONVERT
OUTFIL FILES=01,INCLUDE=(1,5,CH,EQ,C'F0004'),
OUTREC=(14,2040) ----------> incremented to ignore A001
OUTFIL FILES=02,INCLUDE=(1,5,CH,EQ,C'F0005'),
OUTREC=(14,2040)
END

I am keep trying. If you have any ideas, please let me know.
Thanks again, Kannan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Mar 13, 2003 1:15 pm    Post subject: Reply with quote

kannan,

Please post the complete sysout messages. As such sort products will put an * indicating the approximate position of the error.

just a guess did you miss the comma after the include condition on outfil.i.e a comma is required before outrec

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kannan
Beginner


Joined: 13 Mar 2003
Posts: 5
Topics: 2

PostPosted: Fri Mar 14, 2003 4:30 am    Post subject: Reply with quote

Hi Kolusu,

I got it . I have given a space in outrec(OUTREC =(14,2040)). That's where the problem and other thing is, in every FB OUTREC, it is required to give the exact lrecl. This is also corrected and it is working fine now.

Thanks for your help. - Kannan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group