View previous topic :: View next topic
|
Author |
Message |
gopalkulkarni
New User
Joined: 13 Aug 2007 Posts: 12 Location: Pune, India
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What is the recfm of the file? |
|
Back to top |
|
|
gopalkulkarni
New User
Joined: 13 Aug 2007 Posts: 12 Location: Pune, India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is the length of the record the only way to determine the correct records ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks for that tip, Frank - that's a "single step solution" |
|
Back to top |
|
|
gopalkulkarni
New User
Joined: 13 Aug 2007 Posts: 12 Location: Pune, India
|
|
|
|
Thanks, I will try this option. |
|
Back to top |
|
|
|