|
View previous topic :: View next topic
|
| Author |
Message |
sunil_ku Currently Banned New User
Joined: 09 Oct 2007 Posts: 1 Location: chennai
|
|
|
|
>Input record .:
Vin# Module Configuration data
(starts from position 1st) (start its from 118th position) (starts from 148th position)
1FMEU31K48LA05353 CFG_726_WB_00 123456789012345678901234567890
1FMEU31K48LA05353 CFG_726_WB_01 12324567500000000000
1FMEU31K48LA05353 CFG_726_WB_02 5748749590079997997
1FMEU31K48LA05353 CFG_726_WB_03 65758697054345756886
1FMEU31K48LA05353 CFG_726_WB_04 12672589638907490670
1FMEU31K48LA05353 CFG_726_WB_05 1200 ---------------------------------------------> This data will remain as it is (1200)
1FMEU31K48LA05353 CFG_726_WB_06 01234567890
1FMEU31K48LA05353 CFG_726_WB_07 12768469283679237590
1FMEU31K48LA05353 CFG_726_WB_08 12769123472875089325
1FMEU31K48LA05353 CFG_726_WB_09 1234567890 ------------------------------------> this data should change to "8001000000"
1FMEU31K48LA05353 CFG_726_WB_0A 123456789012222222
00,01,02,03,04,05,06,07,08,09,0A===> block number. Each block can hold up to max of 50 bytes(100 characters),
2 >Requirement:
a> 10 th position of the Vin# = 7 0r 8
11th position of the Vin# = L
and 1FMEU31K48LA05353 CFG_726_WB_05 1200
;
:
then 1FMEU31K48LA05353 CFG_726_WB_09 8001000000
3>Failaid that I wrote for the above requirement:
//CSSTEP1A EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//DD01 DD DSN=IFS1965.TEST.BCE.INPUT.DATA,
// DISP=SHR
//DD01O DD DSN=IFS1965.BCE.OUT1,
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=264,BLKSIZE=27984),
// SPACE=(CYL,(10,10),RLSE)
//SYSIN DD *
$$DD01 COPYALL IF=(10,EQ,C'8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_05'),AND=(148,EQ,C'1200'),
AND=(10,EQ,C'8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_09'),REPL=(148,C'8001000000 '),
/*
When I execuite this fileaid Data not yet changed as per the requirement.
Please correct the FileAid if it wrong and please tell any other ways to satisfy the above condition apart from fileaid. |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sunil,
| Quote: |
| AND=(118,EQ,C'CFG_726_WB_05'), |
| Quote: |
| AND=(118,EQ,C'CFG_726_WB_09'), |
I have not used FA in batch mode much.
Check the possibility of TWO values occuring at 118 position in the SAME record.
Revisit your control card and put the conditions properly. |
|
| Back to top |
|
 |
cpuhawg
Active User

Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
You are on the right track:
| Code: |
$$DD01 COPYALL IF=(10,EQ,C'8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_05'),AND=(148,EQ,C'1200'),
AND=(10,EQ,C'8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_09'),REPL=(148,C'8001000000 '),
|
If effect, the code above states that 'CFG_726_WB_05' and 'CFG_726_WB_09' must be in the same position because you connected all the logic with ANDs.
Your code should look like:
| Code: |
$$DD01 COPYALL IF=(10,EQ,C'7,8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_05'),AND=(148,EQ,C'1200'),
REPL=(148,C'1200'),
IF=(10,EQ,C'7,8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_09'),REPL=(148,C'8001000000 ')
|
This codes state if position 10 is EQ to '7' or '8' and position 11 is EQ to 'L' and position 118 is EQ to 'CFG_726_WB_05' and position 148 is EQ to '1200', then replace 148 with '1200'. It then checks to see if position 10 is EQ to '7' or '8' and position 11 is EQ to 'L' and position 118 is EQ to 'CFG_726_WB_09', then replace position 148 with '8001000000 '. All records all copied from the input to the output file because you are using COPYALL.
If the '1200' isn't going to change, there is no need to have the logic for that. You could use:
| Code: |
$$DD01 COPYALL IF=(10,EQ,C'7,8'),AND=(11,EQ,C'L'),
AND=(118,EQ,C'CFG_726_WB_09'),REPL=(148,C'8001000000 ')
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|