Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to check record length of record in PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to check record length of record in PS file
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: 2150
Location: At my coffee table

PostPosted: Mon Apr 26, 2010 4:50 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 26, 2010 5:19 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Apr 26, 2010 6:46 pm    Post subject:
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 Moderator


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

PostPosted: Mon Apr 26, 2010 11:18 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Apr 27, 2010 7:04 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us