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
 

 

Need particular value from a PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need particular value from a PS file
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: 1439
Location: Bangalore,India

PostPosted: Wed Mar 12, 2008 1:03 pm    Post subject:
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 -


https://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    Post subject: Reply to: Need particular value from a PS file
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 Moderator


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

PostPosted: Wed Mar 12, 2008 9:30 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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