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
 

 

Delimited File -Unable to Find solution

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Dimpy Udhani

New User


Joined: 24 Nov 2014
Posts: 3
Location: India

PostPosted: Mon Nov 24, 2014 11:40 am    Post subject: Delimited File -Unable to Find solution
Reply with quote

Hi,

I have a delimited FB file -LRECL -340 ,separated by '|' . Every feild in the record is separated by '|' .

Example
Code:

3|4|5|6|7|8|9|10|11|12|FATCA|US|3|d|xd|s|d|d|d|d|d|d|d|u|s|s|s|s|GOOD 3|4|5|6|7|8|9|10|11|12|12|s|3|d|xd|s|d|d|d|BAD                       
3|4|5|6|7|8|9|10|11|12|12|s|3|d|xd|s|d|d|d|d|d|d|d|u|s|s|s|s|BAD     
3|4|5|6|7|8|9|10|11|12|FATCA|US|3|d|xd|s|d|d|d|GOOD                 
3|4|5|6|7|8|9|10|11|12|12|s|3|d|xd|s|d|d|d|d|d|d|d|u|s|s|s|s|GOOD


No of feilds -29
Delmiter -28

I want to acheive two things
1) if the no of delimiter is 28 ,then move in correct file - file1 and if no of delimiter is not 28 ,then move in incorrect file -file2

2) If the 11th field in the correct file is FATCA , and 12th feild in the file is US ,then move in final correct file FILE 3


I have acheived 1)if the no of delimiter is 28 ,then move in correct file - file1 and if no of delimiter is not 28 ,then move in incorrect file -file2

but unable to acheive the 2 point .


1) i have acheived through the below JCL

Code:
//SYSIN DD *                                                         
  OPTION COPY                                                       
 INREC PARSE=(%=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),   
              %28=(STARTAT=C'|',FIXLEN=1),                           
              %29=(STARTAT=C'|',FIXLEN=1)),                         
  OVERLAY=(341:%28,%29)                                             
  OUTFIL FNAMES=GOOD,INCLUDE(341,1,CH,EQ,C'|',AND,342,1,CH,EQ,C' '),
  BUILD=(1,340)                                                     
  OUTFIL FNAMES=BAD,SAVE,BUILD=(1,340)                               


Kindly help me in solving the 2nd point also and if possible in the same jcl as above.

Thanks and Regards,
Dimpy Udhani
i want if 12th feild in the record is FATCA ,then move it into some other file .

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Nov 24, 2014 1:08 pm    Post subject: Reply to: Delimited File -Unable to Find solution
Reply with quote

Your File 3 is a subset of File 1. So repeat that INCLUDE= on another OUTFIL and expand it to test the two extra PARSEd fields that you want.
Back to top
View user's profile Send private message
Dimpy Udhani

New User


Joined: 24 Nov 2014
Posts: 3
Location: India

PostPosted: Mon Nov 24, 2014 2:02 pm    Post subject:
Reply with quote

I tried using include statement but unable to acheive the result .

Can u help with the include statement .I am new to JCL solutions .Have been trying to try different solutions through different sites.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Nov 24, 2014 2:09 pm    Post subject: Reply to: Delimited File -Unable to Find solution
Reply with quote

If you show what you tried., we can fix it. Explain what it was that didn't work.
Back to top
View user's profile Send private message
Dimpy Udhani

New User


Joined: 24 Nov 2014
Posts: 3
Location: India

PostPosted: Mon Nov 24, 2014 2:22 pm    Post subject:
Reply with quote

I tried with the below Jcl

Code:
OPTION COPY                                                           
NREC PARSE=(%=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
            %28=(STARTAT=C'|',FIXLEN=1),                             
            %29=(STARTAT=C'|',FIXLEN=1)),                             
OVERLAY=(341:%28,%29)                                                 
OUTFIL FNAMES=GOOD,INCLUDE(341,1,CH,EQ,C'|',AND,342,1,CH,EQ,C' '),   
BUILD=(1,340)                                                         
OUTFIL FNAMES=GOOD,INCLUDE(341,5,CH,EQ,C'FATCA',AND,342,1,CH,EQ,C' '),
BUILD=(1,340)                                                         
OUTFIL FNAMES=BAD,SAVE,BUILD=(1,340)   





Also i Tried the below Jcl where i was targetting to acheive only point 2 and not point 1


Code:
//SORTIN DD DSN=NCSD.FATCA.FILE3,DISP=SHR                               
//GOOD   DD DSN=NCSD.FATCA.FILE4,                                       
//           DISP=(OLD,CATLG,DELETE),                                   
//           SPACE=(TRK,(30,30)),                                       
//           DCB=(RECFM=FB,LRECL=340,BLKSIZE=0)                         
//SYSIN  DD *                                                           
  OPTION COPY                                                           
 INREC PARSE=(%=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),%=(STARTAT=C'|'),       
              %=(STARTAT=C'|'),%=(STARTAT=C'|'),                       
              %09=(STARTAT=C'|',FIXLEN=1),                             
              %10=(STARTAT=C'|',FIXLEN=1)),                             
 OVERLAY=(341:%09,%10)                                                 
 OUTFIL FNAMES=GOOD,INCLUDE(341,5,CH,EQ,C'FATCA',AND,342,1,CH,EQ,C' '),
 BUILD=(1,340)


Code'd
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Mon Nov 24, 2014 6:05 pm    Post subject: Reply to: Delimited File -Unable to Find solution
Reply with quote

Picky hat on (as usual): 1 - you are not wanting JCL but sort control cards (if you do not believe me look up those keywords in the JCL Language Reference manual - not a sort manual)
2 - please note that spacing is retianed when you use the code tags so use them as spaces can be important with control cards
3 - Saying it did not work is useless. Cut and paste the messgaes from your job into the reply box and use the code tags so that everything lines up.

Use the prevew button to check your post before submitting.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Mon Nov 24, 2014 7:11 pm    Post subject: Reply to: Delimited File -Unable to Find solution
Reply with quote

Quote:
...unable to acheive the result...
What does that mean ? Did you get an error ? wrong result ?

Looking at your code full of mistakes, it must be an error: 'I' missing in INREC, '=' missing in INCLUDE, FNAMES duplicated, INCLUDE conditions out of target...

Include conditions: col 341 contains the first character of parameter %28, col 342 first char of param %29.
No '|' and no FATCA there...

Why no %11 and %12 in the parse statement ?
You have FIXLEN=1 versus C'FATCA'. Do you plan to compress 5 characters into one ?

Make an effort, Please !
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Nov 24, 2014 7:43 pm    Post subject: Reply to: Delimited File -Unable to Find solution
Reply with quote

You are also using the same DDName for two OUTFILs. If you want three files, you need three separate FNAMES. If you want two, you need only two OUTFILs.

As Marso indicates, you are doing nothing to actually extract any data except the bars. You need to extract the FATCA-field. You need to include it in your OVERLAY. You need to adjust your start and length for the test of it.

The FATCA data is a subset of the GOOD data. So you need the condition for the GOOD as the first part of your INCLUDE= for the third file, then the FATCA stuff.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 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
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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