Writing a header using the data inside the input file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Writing a header using the data inside the input file

Postby sreekanth_reddy » Fri Apr 17, 2020 1:53 pm

Hi,

My requirement is to build a sort card which will do the following this for me

My input data:
record length is 90

ABC .............[spaces]20200417(date)
DEF .............[spaces]20200417
GHI .............[spaces]20200417

1) i want a write the header with date, where date should be taken from the input file as mentioned as (date)
2) i want to change the record length from 90 to 20
3) i want to convert the data b/w 4th byte to 12th byte to HEX

output file should be like

Header (Date inside the input file)
ABC .............
DEF .............
GHI .............

please help me in writing sort for this condition.
Thanks in advance
sreekanth_reddy
 
Posts: 5
Joined: Wed Apr 08, 2020 8:15 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Writing a header using the data inside the input file

Postby NicC » Fri Apr 17, 2020 3:04 pm

Please use the code tags when presenting data. As it stands, the data you posted is unclear - are the strings "[spaces]" actual data or some method of indicating spaces in your data?

Without code tags:
abc def
with code tags:
abc    def

I cut and pasted the data between the two examples so it is identical.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Writing a header using the data inside the input file

Postby sreekanth_reddy » Fri Apr 17, 2020 4:39 pm

Sorry for confusion

Input data:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9
AB    12   12 1 1        1 1  12     1   12                                       20200101
CD    12   12 1 1        1 1  12     1   12                                       20200101
EF    12   12 1 1        1 1  12     1   12                                       20200101
GH    12   12 1 1        1 1  12     1   12                                       20200101
 

Expected Output :
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9
Header: 20200101
AB    12   12 1 1        1 1  12     1   12
CD    12   12 1 1        1 1  12     1   12
EF    12   12 1 1        1 1  12     1   12
GH    12   12 1 1        1 1  12     1   12
sreekanth_reddy
 
Posts: 5
Joined: Wed Apr 08, 2020 8:15 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Writing a header using the data inside the input file

Postby NicC » Fri Apr 17, 2020 4:47 pm

Use the sodding code tags! withoutthem the data does not line up.

Don't know what the code tags are? Research the forums. Or use the "POST REPLY" button instead of the "Quick Reply" button.

Meanwhile I have applied the tags to your data and aligned it properly,
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Writing a header using the data inside the input file

Postby sergeyken » Fri Apr 17, 2020 6:16 pm

sreekanth_reddy wrote:1) i want a write the header with date, where date should be taken from the input file as mentioned as (date)
2) i want to change the record length from 90 to 20
3) i want to convert the data b/w 4th byte to 12th byte to HEX


0) RTFM, RTFM, and RTFM

1) there is a date field in every input record. Which one do you want to use for the header???

2) use BUILD= parameter

3) use option HEX within BUILD parameter
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Writing a header using the data inside the input file

Postby sreekanth_reddy » Fri Apr 17, 2020 9:22 pm

there is a date field in every input record. Which one do you want to use for the header???

Ans: Every record has a date at last.. now i want remove that date at last for each record in the file and place single date as a header.
Here date is not current date or system date... date might be differs but all records in the file will be same date.
sreekanth_reddy
 
Posts: 5
Joined: Wed Apr 08, 2020 8:15 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Writing a header using the data inside the input file

Postby sergeyken » Sat Apr 18, 2020 1:18 am

sreekanth_reddy wrote:there is a date field in every input record. Which one do you want to use for the header???

Ans: Every record has a date at last.. now i want remove that date at last for each record in the file and place single date as a header.
Here date is not current date or system date... date might be differs but all records in the file will be same date.

Which one do you want to use for the header???
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Writing a header using the data inside the input file

Postby NicC » Sat Apr 18, 2020 1:59 am

As per the original post - the first record. But it can be from any record as, per the last post, each record has the same date.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Writing a header using the data inside the input file

Postby sreekanth_reddy » Sat Apr 18, 2020 7:31 am

Which one do you want to use for the header???
sergeyken

Ans: I want to keep first record date as header.

Why I said any record bcz there date is common for every record .
After writing that date as header... I want to truncate the date and reduce the record length.
sreekanth_reddy
 
Posts: 5
Joined: Wed Apr 08, 2020 8:15 pm
Has thanked: 1 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post