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 

Bypass certain records from QSAM file

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


Joined: 27 Nov 2008
Posts: 31
Topics: 9
Location: India

PostPosted: Thu Nov 07, 2013 4:11 pm    Post subject: Bypass certain records from QSAM file Reply with quote

Hi All,

Could you please help me out with the below production issue?

I am currently working on the production issue in which the program is abending with invalid record. The master QSAM file (driver file) of the program contains header , detail(s) and trailer record. The program is abending since particular field in detail records is invalid. As a work around we are looking to bypass the invalid records.
One option I could think of is to modify the program, bypass the those records, update the trailer count. But I dont want to modify the program.

The other option I could think of, is to use some sort step. Is it possible using sort to bypass the records and update the trailer count in a single sort step.

Could you please help me on this, if its not possible using sort or any other means than i would need to modify the program?

Regards,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Nov 07, 2013 4:47 pm    Post subject: Reply with quote

lenovo,

Quite easy. Here is an example of eliminating records with invalid numeric data for detail records and updating the trailer count to reflect the count. The trailer count starts at position 25 for a length of 8 bytes with leading zeroes suppressed.

Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
HDR LENOVO                                           
----+----1----+----2----+----3----+----4----+----5----
RECORD   20                                           
RECORD   30                                           
RECORD   AB                                           
RECORD   40                                           
RECORD   60                                           
RECORD   CC                                           
TRL DETAIL RECORD COUNT:       6                     
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  OPTION COPY                                         
  INCLUDE COND=(1,3,SS,EQ,C'HDR,TRL',OR,             
                10,2,FS,EQ,NUM)                       
                                                     
  OUTFIL IFTRAIL=(HD=YES,TRLID=(1,3,CH,EQ,C'TRL'),   
  TRLUPD=(25:COUNT=(M10,LENGTH=8)))                   
//*


The output from this is
Code:

HDR LENOVO                     
RECORD   20                     
RECORD   30                     
RECORD   40                     
RECORD   60                     
TRL DETAIL RECORD COUNT:       4

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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