ContributionsMost RecentMost LikesSolutionsRe: How to read cobol binary file Hi Krishna You have to setup a file in Cobol copybook parser , file name like dataformat.cfd And the data inside file is like below one ****************************************************************** * COBOL DECLARATION FOR THE DATA ****************************************************************** 01 RECORD-1. 02 Field1 X(10). 02 Field2 X(3). 02 Field3 X(2). 02 Field4 X(1). 02 Field5_PIC X(2). 02 Field6_PIC X(2). 02 FILLER_PIC X(1). ****************************************************************** * THE NUMBER OF COLUMNS DESCRIBED HERE IS 8 ****************************************************************** and here X() should represents the width, you have to check with functional on this exact width. 01 --- is the entire record From 02-- are the column names Re: Mulitple Files trying to be processed Could you provide a sample Pipeline regarding to parse and transform the files one by one Re: How to perform looping for multiple columns to get a single column data Iteration condition: IF @ITERATION=1 THEN ($TYP : $A : $B : ‘A’ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : ‘B’ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : ‘$C’ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : ‘D’ : $NO : SPACE(61) : $D ) According to this iteration condition, we have to generate the values till to the last iteration i.e., iteration4 ($TYP: $A: $B : ‘D’ : $NO : SPACE(61) : $D ). In mapper I’m getting the $A,$B,$C,$D FIELDS along with those columns need to add spaces …. In a mapper I have spitted the expression into 4 parts like ITERATION=1 $TYP : $A : $B : ‘A’ : $C : SPACE(6) : $CD : SPACE(17)) ---$LVRECORD1 ITERATION=2 ($TYP : $A : $B : ‘B’ : $NO : $G : SPACE(31) ) ---$LVRECORD2 ITERATION=3 ($TYP : $A : $B : ‘$C’ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )--- $LVRECORD3 ITERATION=4 ($TYP: $A: $B : ‘D’ : $NO : SPACE(61) : $D ). ) ---$LVRECORD4 In the next mapper Next mapper Same for all the 4 source columns I have taken the target as $LVRECORD Output: ABCD CD A iteration1 ABCD NO G A iteration2 ABCD CD F DTGH A iteration3 TYP ADNO CD A iteration4 Re: Unique Constraint Issue in Oracle while inserting Data Solved this scenario in a different way. Insert handled by using inner join. For Update Here I have to update 2 columns($status, $ID) based on 6 key columns matching data. So, I have read the target table as reference table($col_Ref) and regular/new data as left side data and performing an inner join based on 6 key columns. There I found the matching data. I put 1 filter to sort $status=“Active” I just mapped 2 ($status hardcoded as “INACTIVE” I have to update the $status column if $stat=“Active”, $ID taken from filter ) columns which I want to update in the Target Table. Finally in Oracle Update snap mentioned Schema and table name. In where clause $Status=“Active”. This was one of the ways that I found for resolving this issue. If we have any other ways to handle this, then it could be helpful. Re: Unique Constraint Issue in Oracle while inserting Data Thanks for the reply. The WHERE condition why I wrote like that means I can’t read the data from any table . It’s a combination of 2 tables data then have to perform Change capture (update,delete,insert). So, is there any option to resolve this issue? Not able to read/fetch those mapper columns in the DB snap that’s the issue here. What I want is how to write the query without selecting data from DB , by using WHERE clause we have to do . Re: How to perform looping for multiple columns to get a single column data Iteration condition: IF @ITERATION=1 THEN ($TYP : $A : $B : ‘A’ : $C : SPACE(6) : $$CD : SPACE(17) )ELSE IF @ITERATION=2 THEN ($TYP : $A : $B : ‘B’ : $NO : $G : SPACE(31) )ELSE IF @ITERATION=3 THEN ($TYP : $A : $B : ‘$C’ : $NO : SPACE(16) : $F : $DT : $GH : SPACE(23) )ELSE ($TYP : $A : $B : ‘D’ : $NO : SPACE(61) : $D ) In mapper split the Iteration conditions into 4 columns with different names And then make copy of data. map 1st iteration column to $RECORD column and follow the same for remaining 3 iteration conditions. The target column should be $RECORD for all 4 mappers. After that I used union and capture the $RECORD column in mapper and finally Got the result. Unique Constraint Issue in Oracle while inserting Data In this Scenario, I have to insert data onto an Oracle DB. Before that one I’m performing a Left Outer join and separating the data (for Update and Insert) by using router. In Insert snap I have to insert all the data ,before that one Need to check whether the data is matching with Target table / not . If yes ignore those records if not then perform insert . This was the whole logic . I have to take data columns from mapper and check the columns with oracle target table if data is already exists/not. But, Unfortunately It was troughing errors. INSERT INTO Schema.tablename (DEST,FROM_D,INSRT_BY,INSRT_DT,LVL,TO_D,UPDT_DT) VALUES (‘“+$DEST+”’,‘“+$FROM_D+”’,‘“+$INSRT_BY+”’,‘“+$INSRT_DT+”’,‘“+$LVL+”’,‘“+$TO_D+”’,‘“+$UPDT_DT+”’) WHERE (DEST<>‘“+$DEST +”’ AND LVL<>‘“+$LVL +”’) Where condition columns are Primary Keys to the table. DEST,FROM_D,INSRT_BY,INSRT_DT,LVL,TO_D,UPDT_DT ---- Table columns ‘“+$DEST+”’,‘“+$FROM_D+”’,‘“+$INSRT_BY+”’,‘“+$INSRT_DT+”’,‘“+$LVL+”’,‘“+$TO_D+”’,‘“+$UPDT_DT+”’ ---- Mapper columns/Data I think Experts will find a best solution for this issue. @bojanvelevski @del @AleksandarAngelevski @Spiro_Taleski Please help on this issue. SolvedRe: Writing flat file @del Could you please help on this issue. Re: Writing flat file Re: Writing flat file After trying this scenario. I want read that file and send the data to AWS.But, I’m getting same thing again in the Fixed width Parser