|
View previous topic :: View next topic
|
| Author |
Message |
Mai
New User
Joined: 12 Dec 2007 Posts: 4 Location: California
|
|
|
|
Hi,
There is an input date file. there are a few output files.
DD01 = Datecard.file { 20 LRECL}
DD02 = Output {80 LRECL}
DD03 = Output {80 LRECL}
DD04 = Output {80 LRECL} .....
I would like to copy the 5 chars from pos. 12 from DD01 to 45th pos. in DD02, DD03 etc... output files. What are the statements to use in JCL.
Your immediate response is greatly appreciated!!
Thank you |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Mai,
| Quote: |
| I would like to copy the 5 chars from pos. 12 from DD01 to 45th pos. in DD02, DD03 etc... output files. What are the statements to use in JCL. |
Its confusing. Could you explain clearly.
Also, show some examples of your req. |
|
| Back to top |
|
 |
Mai
New User
Joined: 12 Dec 2007 Posts: 4 Location: California
|
|
|
|
Oops!! Unfortunately, over explanation turned out to be confusing.
There is one I/P File.
Layout
DATE 20071023 DATADATADAT
O/P File 1: xxxxxxxxx20070101 xxxxxxxxxxxxxxxx
O/P File 2: yyyyyyyyy20070201 yyyyyyyyyyyyyyyy
etc...
I would want to replace only the O/P file date value with the I/P file. There are multiple o/p files with different dates.
The result should be
O/P File 1: xxxxxxxxx20071023 xxxxxxxxxxxxxxxx
O/P File 2: yyyyyyyyy20071023 yyyyyyyyyyyyyyyy
How to achieve this thru FILEAID Batch control card.
Thank you |
|
| Back to top |
|
 |
cpuhawg
Active User

Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
You could probably accomplish this using two FILEAID steps. The 1st step reads the DATE record and creates the $$DD02 through $$DD04 control cards to UPDATE the other files in position 45.
| Code: |
//FILEAID1 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD *
DATE 20071023
//DD01O DD DSN=HLQ.FILEAID.CONTROL.CARD,
// DISP=(NEW,CATLG),
// UNIT=(SYSDA),SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920)
//SYSIN DD *
$$DD01 USER PADCHAR=C' ',
IF=(12,NE,C" "),
MOVE=(1,C"$$DD02 UPDATE REPL=(45,C'"),MOVE=(26,8,12),
MOVE=(34,C"')"),WRITE=DD01O,
MOVE=(1,C"$$DD03 UPDATE REPL=(45,C'"),MOVE=(26,8,12),
MOVE=(34,C"')"),WRITE=DD01O,
MOVE=(1,C"$$DD04 UPDATE REPL=(45,C'"),MOVE=(26,8,12),
MOVE=(34,C"')"),WRITE=DD01O
/*
|
The HLQ.FILEAID.CONTROL.CARD dataset should now contain:
| Code: |
$$DD02 UPDATE REPL=(45,C'20071023')
$$DD03 UPDATE REPL=(45,C'20071023')
$$DD04 UPDATE REPL=(45,C'20071023')
|
The HLQ.FILEAID.CONTROL.CARD dataset should now be brought into the 2nd FILEAID step as SYSIN.
The HLQ.TEST1, HLQ.TEST2, and HLQ.TEST3 files are input as DD02, DD02, and DD04, respectfully.
HLQ.TEST1 contains:
| Code: |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
HLQ.TEST2 contains:
| Code: |
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
HLQ.TEST3 contains:
| Code: |
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
The 2nd FILEAID step should execute with:
| Code: |
//FILEAID2 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD02 DD DISP=SHR,DSN=HLQ.TEST1
//DD03 DD DISP=SHR,DSN=HLQ.TEST2
//DD04 DD DISP=SHR,DSN=HLQ.TEST3
//SYSIN DD DISP=SHR,DSN=HLQ.FILEAID.CONTROL.CARD
|
After it executes, the output looks like the following:
HLQ.TEST1:
| Code: |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx20071023xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx20071023xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx20071023xxxxx
|
HLQ.TEST2:
| Code: |
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy20071023yyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy20071023yyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy20071023yyyyy
|
HLQ.TEST3:
| Code: |
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz20071023zzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz20071023zzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz20071023zzzzz
|
If this is not your exact requirement, you can probably adjust the JCL and control cards as needed. |
|
| Back to top |
|
 |
Mai
New User
Joined: 12 Dec 2007 Posts: 4 Location: California
|
|
|
|
Hi cpuhawg,
Thank you very much for your response. This is truly the solution. I would n't be trying this till next work day but great tweaking on Control card. My query can be considered resolved. I appreciate your time & Effort. Thank you Mai |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|