预告片中的日期格式 [英] Date format in Trailer

查看:161
本文介绍了预告片中的日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OPTION COPY                                                 
  OUTFIL  REMOVECC,                                          
      TRAILER1=('FT',DATE,55X,COUNT=(EDIT=(IIITT)),   
     299X,TOTAL=(370,13,SFF,EDIT=(STTTTTTTTT.TT),       
                        SIGNS=(+,-),                    
                        LENGTH=13))                     

我有带有上述选项的预告片记录.在这种情况下,日期以格式显示,但我希望日期仅以2014-10-21格式显示. 我的预告片记录如下所示.

I have a Trailer record with the above options. In this scenario, the date is displayed in the format but I want the date to be displayed in the format 2014-10-21 only. My trailer record will look like below.

FT10/21/14       04    +000000192.21

应该如下所示. FT2014-10-21 04 +000000192.21

It should be like below. FT2014-10-21 04 +000000192.21

此外,在这一本书中,我找到了所有记录的计数以及所有记录的总数.我的输入文件在第2列中具有A或L,在第370列中具有对应的数量.我还想找到在第2列中具有A或L的记录的计数,以及这些记录的总数.我也必须在预告片记录中显示此计数和总和.

Also, in this one I have found the Count of all the records and the total of all records. My input file has A or L in column 2 and corresponding amounts in column 370. I also want find the count of the records that have A or L in column 2 and also the total of those records. I have to display this count and sum in the trailer record too.

注意:在我的预告片中,我需要以yyyy-mm-dd格式显示当前日期,并且我已经在显示所有输入记录的计数和总计了,我还想显示计数值和总计的总和.在第2列中记录A或L,并在第370列中记录相应数量的总和.

Note: in my trailer, I need to display the current date in the format yyyy-mm-dd and I am already displaying the count and total of all the input records, I also want to display the count and total of the records with A or L in column 2 and the total of the corresponding amounts in column 370.

根据比尔提供的答案,这就是我的意思.

Based on the answer provided by Bill, this is what I have.

//SORTA    EXEC PGM=SORT                                                
//SORTIN   DD  DSN=TESTIBN.MYFILE.CHGHIS.SAMP,                    
//             DISP=SHR                                                 
//SORTOUT  DD  DSN=TESTIBN.MYFILE.CHGHIS.NEW,                     
//             DISP=(NEW,CATLG,DELETE),                                 
//             UNIT=SYSDA,                                              
//             RECFM=FB                                                 
//SORTWK01 DD  SPACE=(CYL,(364)),                                       
//             UNIT=SYSDA                                               
//SORTWK02 DD  SPACE=(CYL,(364)),                                       
//             UNIT=SYSDA                                               
//SORTWK03 DD  SPACE=(CYL,(364)),                                       
//             UNIT=SYSDA                                               
//SORTWK04 DD  SPACE=(CYL,(364)),                                       
//             UNIT=SYSDA                                               
//SORTWK05 DD  SPACE=(CYL,(364)),                                       
//             UNIT=SYSDA                                               
//SYSPRINT DD  SYSOUT=*                                                 
//SYSOUT   DD  SYSOUT=*                                                 
//SYSIN    DD  *                                                        
  OPTION COPY                                                           
   OUTFIL  REMOVECC,                                                    
            TRAILER1=('FT',DATE=(4MD-),55X,COUNT=(EDIT=(IIITT)),        
           299X,TOTAL=(370,13,SFF,EDIT=(STTTTTTTTT.TT),                 
                              SIGNS=(+,-),                              
                              LENGTH=13)) 

是,记录长度为500.输入文件的位置2仅具有A或L,仅用于少数记录.这些是调整记录.他们的位置2可能有C,以进行收费记录.我已经将所有记录(费用+调整额)的总计放入了预告片中,现在我还必须将调整记录的计数和总计也放入.

Yes, the record length is 500. The input file has A or L in position 2 only for few records. These are adjustment records. They may have C in position 2 for charge records. I have already put the totals of all the records (charge+adjustments) in the trailer, now I have to put the count and total of the adjustment records as well.

推荐答案

来自DFSORT应用程序编程指南

From the DFSORT Application Programming Guide

DATE =(abcd)

DATE=(abcd)

指定当前日期将出现在报表记录中 格式为"adbdc",其中a,b和c表示 将显示月份,日期和年份,以及是否显示年份 以两位或四位数字表示,而d是用于分隔的字符 月,日和年.对于a,b和c,使用M表示月份 (01-12),D代表日期(01-31),Y代表最后两个 年份的数字(例如05)或4代表四个数字 年份的数字(例如2005). M,D和Y或4可以分别是 仅指定一次.示例:DATE =(DMY.)将产生日期 格式"dd.mm.yy"(2005年3月29日显示为"29.03.05"). DATE =(4MD−)将产生格式为'yyyy-mm-dd'的日期, 2005年3月29日,将显示为"2005-03-29".

specifies that the current date is to appear in the report record in the form 'adbdc', where a, b, and c indicate the order in which the month, day, and year are to appear and whether the year is to appear as two or four digits, and d is the character to be used to separate the month, day and year. For a, b, and c, use M to represent the month (01-12), D to represent the day (01-31), Y to represent the last two digits of the year (for example, 05), or 4 to represent the four digits of the year (for example, 2005). M, D, and Y or 4 can each be specified only once. Examples: DATE=(DMY.) would produce a date of the form 'dd.mm.yy', which on March 29, 2005, would appear as '29.03.05'. DATE=(4MD−) would produce a date of the form 'yyyy-mm-dd', which on March 29, 2005,would appear as '2005-03-29'.

说明的最后一行给出了您想要的,这就是用DATE =(4MD-)代替简单的DATE.

The very last line of the description gives you exactly what you want, which is to replace your simple DATE by DATE=(4MD-).

要获取A和L记录的数量和总数:

To get the counts and total amounts of A and L records:

使用

 INREC IFTHEN=(WHEN=INIT,OVERLAY=(position-after-end-of-record:Z,13Z,Z,13Z),

假设您的记录为500字节,并且长度固定为(501:Z,13Z,Z,13Z),

Assuming your records are 500 bytes and fixed in length that would be (501:Z,13Z,Z,13Z),

这将暂时(因为稍后将它们切回)来扩展记录.

This will temporarily (because we'll chop them back later) extend the records.

然后使用两个IFTHEN =(WHEN =(logical-expression)来测试您的A和L.如果使用A,则使用OVERLAY将C'1'放置在位置501,其值从502开始.如果使用L,则使用叠加以将C'1'放置在位置515,金额从516开始.

Then use two IFTHEN=(WHEN=(logical-expression) to test for your A and L. If A, use OVERLAY to put a C'1' in position 501 and the amount starting at 502. If L, use OVERLAY to put a C'1' in position 515 and the amount starting at 516.

修改您的TRAILER1来完成所有这四个字段的TOT/TOTAL.这将为您提供As的计数和As的总量,Ls的计数和Ls的总量.将BUILD =(1,500)添加到您的OUTFIL中,以将记录恢复为原始大小.

Amend your TRAILER1 to do TOT/TOTAL of all those four fields. That will give you the count of As and total amount of As, count of Ls and total amount of Ls. Add BUILD=(1,500) to your OUTFIL to return your records to the original size.

注意,我以500为例.使用记录的实际LRECL.

Note, I'm using 500 as an example. Use the actual LRECL of your records.

如果您有长度可变的记录,则需要稍作更改.

If you have variable-length records, it needs a slight change.

 OPTION COPY

 INREC IFTHEN=(WHEN=INIT,
                OVERLAY=(501:Z,13Z,Z,13Z)),
       IFTHEN=(WHEN=(2,1,CH,EQ,C'A'),
                OVERLAY=(501:C'1',370,13)),
       IFTHEN=(WHEN=(2,1,CH,EQ,C'A'),
                OVERLAY=(515:C'1',370,13))

 OUTFIL  REMOVECC,                                          
         TRAILER1=('FT',DATE,55X,COUNT=(EDIT=(IIITT)),
                   TOTAL=(501,1,ZD,EDIT=(IIITT)),   
                   TOTAL=(502,13,ZD,EDIT=(STTTTTTTTT.TT),       
                                               SIGNS=(+,-),
                   TOTAL=(515,1,ZD,EDIT=(IIITT)),   
                   TOTAL=(516,13,ZD,EDIT=(STTTTTTTTT.TT),       
                                               SIGNS=(+,-),
                   263X,TOTAL=(370,13,SFF,EDIT=(STTTTTTTTT.TT),       
                                               SIGNS=(+,-),                    
                                               LENGTH=13))  

我什至没有把它扔进机器,但它应该很近.

I've not even tossed this into the machine, but it should be close.

我无法确定您要在哪里输入新数字,所以我只是将它们放到299个空白的第一个可用区域中.

I can't tell where you want the new figures, so I've just put them into the first available area of the 299 blanks.

您正在使用OPTION COPY,根本不需要SORTWK文件.您将获得不需要的1500多个圆柱体空间,但这些空间将保持到步骤结束.

You are using OPTION COPY, you do not need SORTWK files at all. You are getting hold of 1,500+ cylinders of space that you don't need, but will hold to the end of the step.

我建议您的网站使用工作区的动态分配进行调查.通过显示的JCL判断,它将大大减少空间争用.

I'd suggest your site investigates using dynamic allocation of workspace. It will greatly reduce space contention judging by the JCL you have shown.

您也不应该为输出文件(SORTOUT)指定任何DCB信息,因为DFSORT会提供所有这些信息,最好仅在一个地方完成此操作,以免引起混淆或错误维护.

You also shouldn't specify any DCB information for the output file (SORTOUT), as DFSORT will provide all that, and best it is done in one place only for clarity and to avoid confusion/error on maintenance.

这篇关于预告片中的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆