Need help in using parsing variable length records and copy



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need help in using parsing variable length records and copy

Postby gauravfrankly » Fri Aug 07, 2015 3:41 pm

Hi All,
I have the following requirement :
1. Variable record length input file of format
companyName|Company no|Surname|DOB|Firstname|Age|KeyINfo
this fill have the tow types of records
for INDIVDUAL and BUSINESS.
If company name is present then that record should be written into BUSINESS file(output file variable length block)
and IF comapnay name is not present and Surname is present then records need to be written into INDIVIDUAL file(outputfie).
Have to perform this using SORT JCL
INDIVIDUAL record : | |verma|26-10-1990| |23|abc
BUSINESS record : abc corp||||||xyz
please gicve me hint to write JCL.
facing issue to categories the records...
Thanks!!
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby BillyBoyo » Fri Aug 07, 2015 4:31 pm

You don't need to use PARSE because the company-name is the first field. If there is no company-name, there is a pipe in position one. So use that.

  OPTION COPY
  OUTFIL FNAMES=PRIV,INCLUDE=(1,1,CH,EQ,C'|')
  OUTFIL FNAMES=BUS,SAVE


The SAVE on OUTFIL will send to that file all records which don't appear on another OUTFIL, like an "else, only if on no other OUTFIL, put them here".
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need help in using parsing variable length records and c

Postby gauravfrankly » Fri Aug 07, 2015 6:31 pm

Thanks Billy. I also have one more query regarding use of FINDREP, shall I ask here?
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby Terry Heinze » Fri Aug 07, 2015 7:14 pm

Ask in this forum (DFSORT/ICETOOL/ICEGENER) but ask it as a new topic.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: Need help in using parsing variable length records and c

Postby gauravfrankly » Tue Aug 18, 2015 10:59 am

Hi Billy,
I need to convert this VB file into 2 diffeerent FB files, INDV and BUSN. and need to remove delimeter '|'.
Output file will be FB,
with following I m not able to remove delimeters.
//STEP10   EXEC PGM=SORT                                         
//SORTIN   DD DSN=INPUT.FILE.1, DISP=OLD   
//SORTOUT1 DD DSN=OUTPUT.FILE,                       
//            DISP=(NEW,CATLG,DELETE),                         
//            DSORG=PS,                                         
//            RECFM=FB,                                         
//            LRECL=440,                                       
//            BLKSIZE=27720,                                   
//            DATACLAS=STANDARD                                 
//SYSPRINT DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  OUTFIL FNAMES=SORTOUT1,VTOF,                                   
  OUTREC=(1:1,440)
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby BillyBoyo » Tue Aug 18, 2015 11:38 am

Just removing the delimiter would be easy with FINDREP, but then you don't really want to only do that, because then you'll never be able to find the data.

You need to use PARSE, to make each delimited input field a fixed-length PARSEd field, and then BUILD your output records from the PARSEd fields.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need help in using parsing variable length records and c

Postby gauravfrankly » Tue Aug 18, 2015 3:33 pm

Thanks Billy,
Can I use OUTFIL fnames inlcude() parse()in single statement.
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby gauravfrankly » Tue Aug 18, 2015 3:47 pm

Billy,
Can I do following two things in single SORT card(input file VB)
1. categories records into BUSN and INDV file using include
2. changes VB records to FB using Parse.
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby gauravfrankly » Tue Aug 18, 2015 4:04 pm

My SORT CARD
//STEP010  EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SORTIN   DD DSN=TTYA.VERMGAU.INPUT,DISP=SHR     
//INDV     DD DSN=TTYA.VERMGAU.INDV,               
//        DISP=(MOD,CATLG),                       
//        DCB=(RECFM=VB,LRECL=300,BLKSIZE=24900), 
//        SPACE=(TRK,(10,10),RLSE),UNIT=SYSDA     
//BUSN     DD DSN=TTYA.VERMGAU.BUSN,               
//        DISP=(MOD,CATLG),                       
//        DCB=(RECFM=VB,LRECL=300,BLKSIZE=24900), 
//        SPACE=(TRK,(10,10),RLSE),UNIT=SYSDA     
//SYSIN    DD *                                   
       OPTION COPY                                 
       OUTFIL FNAMES=INDV,INCLUDE=(1,1,CH,EQ,C'|')
       OUTFIL FNAMES=BUSN,SAVE                     
/*                                                 

My input :
ABC CORP|12345|||||KEYINFO-1|11111
GRV CORPORATION|1123|||||KEY INFO-2|121
PCS PRIVATLIMITEDCOMPANY||||||11123345|123
||VERMA|GAURAV|10/10/1992|M|KEY INFO-INDV1|000123
||GUPTA|RAVI|12/12/1965|M|KEY INDV INFO|000223

OUTPUT;
got all records into BUSN only, no recprds are present in to INDV dataset

Code'd
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in using parsing variable length records and c

Postby BillyBoyo » Tue Aug 18, 2015 4:26 pm

Please use the Code tags to preserve spacing for JCL, Control Cards and data.

You show your output datasets as variable-length. Your input must be variable-length as well. So you are currently looking at the first byte of the RDW each variable-length record is prefixed by. You need to change your INCLUDE= to (5,1....).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post