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

How to check record length of record in PS file


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

New User


Joined: 13 Aug 2007
Posts: 12
Location: Pune, India

PostPosted: Mon Apr 26, 2010 1:03 pm
Reply with quote

Hi,

I want to check the record length of a record in PS file. If record length is not appropriate, I want to remove that record & remaining records should be written into output file. Please suggest me way for this query.

I have used below option :

INREC IFOUTLEN=n,
IFTHEN = ((1,3,CH,C'___'),
BUILD = (1,1000))

It has truncated other records to minimum record length in that PS file.
Also, please let me know whether the above option is right or wrong.

Regards,
Gopal Kulkarni
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 26, 2010 4:50 pm
Reply with quote

What is the recfm of the file?
Back to top
View user's profile Send private message
gopalkulkarni

New User


Joined: 13 Aug 2007
Posts: 12
Location: Pune, India

PostPosted: Mon Apr 26, 2010 5:10 pm
Reply with quote

Hi,

Record format of input file is VB. File contains data for specific records with file length of 1000 bytes. Please provide me solution to this query.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 26, 2010 5:19 pm
Reply with quote

Is the length of the record the only way to determine the correct records ?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Apr 26, 2010 6:46 pm
Reply with quote

Is not this reuquest just similar ? Well, use this JCL as a reference and change as per you needs
Code:
//RDW   EXEC PGM=SORT                           
//SYSOUT  DD   SYSOUT=*                           
//SORTIN  DD   DSN=...vb input,DISP=SHR
//SORTOUT DD   SYSOUT=*                           
//SYSIN   DD    *                                 
  OPTION COPY                                     
  OUTREC BUILD=(1,4,1,2,BI,C'|',5)               
/*                                               
It will give you something like:
Code:
    6 |abcdef       
    9 |123456789   
where 6 and 9 shows the length of varaible-records, in next step you might check for the length from this step to copy the required records.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Apr 26, 2010 11:18 pm
Reply with quote

Quote:
If record length is not appropriate, I want to remove that record


You would use a DFSORT OMIT statement for this, not INREC, e.g.

Code:

    OMIT COND=(1,2,BI,LE,+n)


where n is the length you are interested in.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 27, 2010 7:04 pm
Reply with quote

Thanks for that tip, Frank - that's a "single step solution" icon_smile.gif
Back to top
View user's profile Send private message
gopalkulkarni

New User


Joined: 13 Aug 2007
Posts: 12
Location: Pune, India

PostPosted: Wed May 12, 2010 12:16 pm
Reply with quote

Thanks, I will try this option.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top