在大型机数据集中的特定列插入数据

时间:2015-07-30 21:19:53

标签: mainframe ispf

我需要从特定列开始,将大型数据集(A)中的数据插入到不同的数据集(B)中。 例如第一个数据集' A'有以下数据

  Command ===>                
  *****************************
  1205271                      
  1205251                      
  6483068                      
  1205257                      

第二个数据集' B'有以下数据

 ----+----7----+----8----+----9----+----0----+----1----+----2----+----
 ********************************* Top of Data ***********************
  EMPLOYER FFFF MMMMMMMM       TTTT    D                        
  EMPLOYER SSSS                TTTT    D                        
  FEDERAL UUUUUUUUUUU XXX      TTTT    D                        
  MI STATE UUUUUUUUUUU         TTTT    D                        
  NN STATE UUUUUUUUUUU         TTTT    D    

最后,数据集B应如下所示,即数据集' A'数据已被插入' B'从专栏' 105'开始。

 ----+----7----+----8----+----9----+----0----+----1----+----2----+----
 ********************************* Top of Data ***********************
  EMPLOYER FFFF MMMMMMMM       TTTT    D     1205271                   
  EMPLOYER SSSS                TTTT    D     1205271                   
  FEDERAL UUUUUUUUUUU XXX      TTTT    D     6483068                   
  MI STATE UUUUUUUUUUU         TTTT    D     1205257                   
  NN STATE UUUUUUUUUUU         TTTT    D        

请告诉我你的建议。 谢谢 Ashish

1 个答案:

答案 0 :(得分:2)

假设您想要包含数据的文件中的LRECL已经足够长了:

Edit your target file
On the command-line `COPY your-source-file`
In the line-command area, put `a ` in the asterisks before for first line of your file
ENTER
Take note of how many lines were copied (look at the line-numbers and calculate if necessary)
Type BNDS in a line-command area
ENTER
Scroll right (usually PF11) to see that your BNDS is not before the end of the final data position that you want
Type the "destructive shift right" edit symbol `)` in block-mode `))` on the first line of your inserted data
Do the same with the last line of your inserted data
After one of the `))` type 104, the number of columns you want to shift column one by (final position, less one)
ENTER 
Use the "move line-command symbol" `m` in block mode `mm` and mark the first and last line of the newly inserted data
Use the "overlay line-command symbol" `o` followed by the previously-noted number of lines copied and mark the original first line of your file
ENTER
Job done

请记住,只要你有RECOVERY ON,你就可以在文件被保存之前更改为文件(还记得END自动保存文件)。

Command ===> copy temp                                        Scroll ===> CSR
a***** ***************************** Top of Data ******************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
=BNDS> <                                                                      >
000100 EMPLOYER FFFF MMMMMMMM       TTTT    D 
000200 EMPLOYER  SSSS               TTTT    D 
000300 FEDERAL  UUUUUUUUUUU XXX     TTTT    D 
000400 MI  STATE UUUUUUUUUUU        TTTT    D 
000500 NN  STATE UUUUUUUUUUU        TTTT    D 
****** **************************** Bottom of Data ****************************


Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
)) 010 1205271 
000020 1205251 
000030 6483068 
))39 0 1205257 
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
=BNDS> <                                                                      >
000100 EMPLOYER FFFF MMMMMMMM       TTTT    D 
000200 EMPLOYER  SSSS               TTTT    D 
000300 FEDERAL  UUUUUUUUUUU XXX     TTTT    D 
000400 MI  STATE UUUUUUUUUUU        TTTT    D 
000500 NN  STATE UUUUUUUUUUU        TTTT    D 


Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001                                        1205271 
000002                                        1205251 
000003                                        6483068 
000004                                        1205257 
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
=BNDS> <                                                                      >
000100 EMPLOYER FFFF MMMMMMMM       TTTT    D 
000200 EMPLOYER  SSSS               TTTT    D 
000300 FEDERAL  UUUUUUUUUUU XXX     TTTT    D 
000400 MI  STATE UUUUUUUUUUU        TTTT    D 
000500 NN  STATE UUUUUUUUUUU        TTTT    D 


Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
mm 001                                        1205271 
000002                                        1205251 
000003                                        6483068 
mm 004                                        1205257 
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
=BNDS> <                                                                      >
o4 100 EMPLOYER FFFF MMMMMMMM       TTTT    D 
000200 EMPLOYER  SSSS               TTTT    D 
000300 FEDERAL  UUUUUUUUUUU XXX     TTTT    D 
000400 MI  STATE UUUUUUUUUUU        TTTT    D 
000500 NN  STATE UUUUUUUUUUU        TTTT    D 

然后它看起来像这样(我已经使用了我想要的列的示例值,40):

Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
=BNDS> <                                                                      >
000100 EMPLOYER FFFF MMMMMMMM       TTTT    D 1205271 
000200 EMPLOYER  SSSS               TTTT    D 1205251 
000300 FEDERAL  UUUUUUUUUUU XXX     TTTT    D 6483068 
000400 MI  STATE UUUUUUUUUUU        TTTT    D 1205257 
000500 NN  STATE UUUUUUUUUUU        TTTT    D