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 

Extract particular records from VB to FB

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


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 21, 2006 1:52 am    Post subject: Extract particular records from VB to FB Reply with quote

HI,
I have a VB input file(sortin) from which I have to copy only the accounts to output FB file. In the input VB file, the acct starts from 13(9+4) with lengh of 13. And also I need the accts with non-spaces at 983-985. so I added a check for non-space in the 983 location.
Please see the file details which I have quoted down.
I need only these accouts in the output file.
Could you please correct the OUTREC field.
Also can I keep the LRECL = 13 for FB output file as I need only the ACCTS.

I am using IERRCO00 which i believe is equivalent to SORT.
Any help is appreciated. Thanks.

Code:

//STEP1 EXEC PGM=IERRCO00                                 
//SYSPRINT DD SYSOUT=*                                     
//SYSOUT DD SYSOUT=*                                       
//SORTIN DD *
200510030900140004357.090014000435709001400043570030900140004
200510030900140006361.090014000636109001400063610030900140006
20051003210A290000406.210A290000406210A290000406003210A290000
20051003210A290000406.21022201573412102220157341003210A290000
20051003210A290000406.51219300445975121930044597003210A290000
//SORTOUT DD *
200510030900140004357
200510030900140006361
20051003210A290000406
20051003210A290000406
20051003210A290000406
//SYSIN    DD *                                           
  INCLUDE COND=(986,3,CH,NE,C'   ')                       
  SORT FIELDS=(13,13,CH,A)                                 
  OUTREC FIELDS=(1,25)                      =====???                               
  SUM FIELDS=NONE                                         
/*                                                         


Quote:

Sortin Dataset name ===> Input.FILE.A.SORT.ACCTS
Record format ===> VB
Record length ===> 3004

O" dataset attributes:
Sortout Dataset name ===> Output.TRACK.ACCTS
Record format ===> FB


Desired:
Quote:

0900140004357
0900140006361
210A290000406
210A290000406
210A290000406


[/img][/code]
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Jul 21, 2006 3:33 am    Post subject: Reply with quote

Vak255,

I had never used IERRCO00 but i have tried in this example.I am creating a new VB File as i did not have a VB File earlier from the STEP010 and then i am using the VB file as input in STEP020 for generting a FB File with LRECL=13 and i am assuming spaces not to occur in pos 22 of the Input FB File in STEP010.Hope it helps.
Code:

//STEP010  EXEC PGM=IERRCO00                                               
//SORTIN   DD *       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--                                                 
200510030900140004357.090014000435709001400043570030900140004           
200510030900140006361.090014000636109001400063610030900140006           
20051003210A290000406.210A290000406210A290000406003210A290000           
20051003210A290000406.21022201573412102220157341003210A290000           
20051003210A290000406.51219300445975121930044597003210A290000           
//VBOUT    DD DSN=SHEKAR.WORK.VB,DISP=(NEW,CATLG,CATLG),               
//            SPACE=(TRK,(1,1),RLSE)                                   
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(13,13,CH,A)                                             
  OUTFIL FNAMES=VBOUT,FTOV                                             
/*                                                                     
//STEP020  EXEC PGM=IERRCO00
//SORTIN   DD DSN=SHEKAR.WORK.VB,DISP=SHR                             
//FBOUT    DD DSN=SHEKAR.WORK.FBOUT,DISP=(NEW,CATLG,CATLG),           
//            SPACE=(TRK,(1,1),RLSE),                                   
//            DCB=(LRECL=13,RECFM=FB,BLKSIZE=130)                       
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INCLUDE COND=(26,1,CH,NE,C' ')                                       
  OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(1:13,13)                             
/*                                                                     
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//                                                                     

OUTPUT
Code:

SHEKAR.WORK.VB

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
200510030900140004357.090014000435709001400043570030900140004                   
200510030900140006361.090014000636109001400063610030900140006                   
20051003210A290000406.210A290000406210A290000406003210A290000                   
20051003210A290000406.21022201573412102220157341003210A290000                   
20051003210A290000406.51219300445975121930044597003210A290000                   

SHEKAR.WORK.FBOUT

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
0900140004357                                                                   
0900140006361                                                                   
210A290000406                                                                   
210A290000406                                                                   
210A290000406                                                                   

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 21, 2006 5:28 am    Post subject: Reply with quote

Thanks Shekar, I will test it and will let you know.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Jul 21, 2006 6:15 am    Post subject: Reply with quote

shekar,
Before. I was getting U0016 - filemismatch error.
As the input file is VB with LRECL = 3004 and output file is FB with LRECl=13

now its working Gr8

Thanks a lot
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