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

Need particular value from a PS file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Wed Mar 12, 2008 12:11 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Mar 12, 2008 1:03 pm
Reply with quote

Agni,

From the below link download the PDF and use the topic

FIND AND EXTRACT VALUES FROM DIFFERENT POSITIONS for your requirement -


www-304.ibm.com/systems/support/storage/software/sort/mvs/tricks/pdf/sorttrck.pdf
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Wed Mar 12, 2008 1:47 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Mar 12, 2008 9:30 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top