Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us