View previous topic :: View next topic
|
Author |
Message |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 150 Location: India
|
|
|
|
Hi all,
I have a PS file let say ALT.PS.FILE1 having LRCL 80 RCFM FB and it is actually an empty file which contains 70 empty lines. I want to copy a data from another ps file ALT.PS.FILE2 to ALT.PS.FILE1. My ALT.PS.FILE2 has some records not sure how many it could be but for sure not more than 70 record. I want to copy data in my empty file which is ALT.PS.FILE1 from ALT.PS.FILE2 in such a way that it copies the record from ALT.PS.FILE2 file and rest of the line should remain blank. for example my ALT.PS.FILE2 has 6 records it should copy 6 records in my empty file from starting position and rest all other 70-6=64 records should be blank record. i hope I am able to explain my requirement here. How this empty file could be edited in this way. I tried many things but no luck till this time. Any help of link to any solution where i can go an read it would be helpful here. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2173 Location: USA
|
|
|
|
What does this mean?
Quote: |
an empty file which contains 70 empty lines. |
Any real example, please, when the used terminology is not clear.
Quote: |
I tried many things but no luck till this time. |
Please, present here AT LEAST ONE of the many things you've tried, including the used code, and all input/output/log data. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1371 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=ICEMAN
//F1 DD *
/*
//F2 DD *
4711
0815
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=F1,FIELDS=(81,8,A),SORTED
JOINKEYS F2=F2,FIELDS=(81,8,A),SORTED
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F2:1,80)
END
/*
//JNF1CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
END
/*
//JNF2CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
END
/* |
|
|
Back to top |
|
 |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 150 Location: India
|
|
|
|
Hi Apologies, i tried my best to explain the situation. let me try again.
I have existing file which is empty and look like below having 43 records max.
Code: |
ssssssssssssssssssssssssssssssssssssssssssssssssss
VIEW ALT0.DB2BIND.INPUT.TRIGGER2
Command ===>
****** ***************************** Top of Data *
000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013
000014
000015
000016 |
like that 000043 max record in above file.
I want to copy the record from another file to this existing file in such a way that copy of the record should start from 00001 postion and rest records should be kept as it is : for example
my input file has 3 record then my existing file should look like below.
Code: |
[quote]EDIT ALT0.DB2BIND.INPUT.TRIGGER2 Colu
Command ===> S
****** ***************************** Top of Data **************
000001 rec1data
000002 rec2data
000003 rec3data=REST BELOW LINE SHOULD BE EMPTY AS IT IS till 43rd record.
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013 |
[/quote]
I am not sure with using sort we can edit the existing file in this way or not .i tried concatenating but that is not giving me desired result. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1371 Location: Bamberg, Germany
|
|
|
|
See my sample. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2173 Location: USA
|
|
|
|
Digvijay Singh wrote: |
I am not sure with using sort we can edit the existing file in this way or not .i tried concatenating but that is not giving me desired result. |
SORT allows usage of an input dataset (but not input file, which is actually a DD statement!) also as output dataset, because the output is written from its temporary storage, at the end of processing. Actually the output dataset is not updated, but overrode.
FYI:
"Empty file" = a dataset with ZERO RECORDS inside of it.
"Empty record" = a record with ZERO bytes inside of it.
"Empty line" - sometimes is used instead of "blank line", but only when from the context it is clear that pure text data is being discussed.
P.S.
Joerg decided to guess by himself what did you mean in your post, but most of the people do not deign to such act of grace, when the used terminology is like Chinese without any samples.
P.P.S.
Remains unclear, what are "the many things you have tried"? |
|
Back to top |
|
 |
|