Posted: Thu Oct 30, 2008 9:09 am Post subject: To Change the first 3 digits of a file
Hello,
i have one input dataset with name like AC8.TXXX.INTERFCE.the input file first 3 digits contains the cty code like XXX ..we need to change XXX to AAA and we need to copy same file to diff dataset with name is like AC8.TAAA.INTERFCE..like we have 32 cty codes we need change and need to copy to diff dataset..
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
Posted: Thu Oct 30, 2008 12:27 pm Post subject:
If you can just rename rather than physically copying the datasets, you could utilize the ALTER in IDCAMS.
Code:
ALTER HLQ.TEMP.XYZ.DSN01.CTL -
NEWNAME(HLQ.TEMP.ABC.DSN01.CTL)
IDC0531I ENTRY HLQ.TEMP.XYZ.DSN01.CTL ALTERED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
ALTER HLQ.TEMP.XYZ.DSN02.CTL -
NEWNAME(HLQ.TEMP.ABC.DSN02.CTL)
IDC0531I ENTRY HLQ.TEMP.XYZ.DSN02.CTL ALTERED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
ALTER HLQ.TEMP.XYZ.DSN03.CTL -
NEWNAME(HLQ.TEMP.ABC.DSN03.CTL)
IDC0531I ENTRY HLQ.TEMP.XYZ.DSN03.CTL ALTERED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
However, when you're changing the HLQ, you need to be aware of restrictions and the behavior depending on whether the datasets are SMS managed or not. Read the ALTER parm section carefully in the Access Method Services manual if you decide to use the ALTER.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Oct 30, 2008 1:10 pm Post subject:
jsharon1248,
I guess you misunderstood the requirement. OP has only one 1 input dataset which needs to be split into multiple files based on the city code
manasa wrote:
i have one input dataset with name like AC8.TXXX.INTERFCE.the input file first 3 digits contains the cty code like XXX ..we need to change XXX to AAA and we need to copy same file to diff dataset with name is like AC8.TAAA.INTERFCE
Need one more help..i am able to change the CTY code in the header record by using your program.but only header record is copied in to the output file..but i need to copy all the records also
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Nov 24, 2008 11:31 am Post subject:
manasa,
Show me the control cards you used. The control cards I gave are splitting the input file based on the first 3 digits in the file. but looks like your input has one header with the code and the rest all detail records.
I am guessing that you have a file with many sets of group records.
Code:
City Group 1 header
detail record1
detail record2
detail record3
detail record4
detail record5
City Group 2 header
detail record1
detail record2
detail record3
City Group 3 header
detail record1
detail record2
...
So on and now you want to split them into different files along with the header , is that it? _________________ Kolusu
www.linkedin.com/in/kolusu
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum