View previous topic :: View next topic
|
Author |
Message |
Agni
New User
Joined: 22 Nov 2007 Posts: 83 Location: Chennai
|
|
|
|
Hi All,
I have a PS file of record length 32633. Its a FB file. I need to take a particular value from each record. The file will look like as below:
Code: |
flklkfjd49840304-3<X_XXXX_XXX>9 digit value</X_XXXX_XXX>fkdk
fjdkffdf<X_XXXX_XXX>9 digit value</X_XXXX_XXX>kdjflkj93988748
<X_XXXX_XXX>9 digit value</X_XXXX_XXX>kdsjfg98760434klgjdlfd
|
From the above records, i want only the 9 digit value. But the starting position of <X_XXXX_XXX>9 digit value</X_XXXX_XXX> may vary in each record. Before and after <X_XXXX_XXX>9 digit value</X_XXXX_XXX> there will be some values that i don't want in my output. I want the 9 digit value alone in a separate PS file.
Can anybody help me out?
Thanks in advance
Agni. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
Agni
New User
Joined: 22 Nov 2007 Posts: 83 Location: Chennai
|
|
|
|
Murali,
Thanks for your reply. But i have a doubt here. In my input file there won't be any spaces after <X_XXXX_XXX>. When i checked the PDF for the "FIND AND EXTRACT VALUES FROM DIFFERENT POSITIONS" i saw that STARTAFT has been used. Is STARTAFT is a mandatory parameter? If so, what should i use in my case as there is no space between the <X_XXXX_XXX> and the required 9 digit value. Also i need to take the 9 digit value that comes before </X_XXXX_XXX>.
Please advise.
Thanks
Agni |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I don't understand your concerns. It would seem that the following DFSORT job would do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/32633)
//SORTOUT DD DSN=... output file (FB/9)
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(STARTAFT=C'<X_XXXX_XXX>',FIXLEN=9)),
BUILD=(%01)
/*
|
This would extract the first 9 byte value found after <X_XXXX_XXX> in every record. If that doesn't work for you, then there's something you're not telling us.
Quote: |
what should i use in my case as there is no space between the <X_XXXX_XXX> and the required 9 digit value |
Why do you think STARTAFT needs a space? It doesn't.
Quote: |
Also i need to take the 9 digit value that comes before </X_XXXX_XXX>. |
In your example, <X_XXXX_XXX> always precedes the 9 digit value so what follows it is irrelevant in terms of extracting the 9 digits. |
|
Back to top |
|
|
|