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
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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