View previous topic :: View next topic
|
Author |
Message |
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Could some one help me please?
I have input like this
Code: |
----+----1----+----2----+----3
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAACCCCCCCCCC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAMMMMMMMMMM
....... |
Expected output
Code: |
----+----1----+----2----+----3----+----4----+----5
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC CTEST1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAACCCCCCCCCC CTEST1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAMMMMMMMMMM MTEST1 |
Code'd |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
First - learn to to use the "Code" tag. This preserves alignment and improves readability.
Post the rules for getting to the output from the input.
Mention the relevant data positions as well as the recfm and lrecl of the files. |
|
Back to top |
|
|
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Sorry for not giving full details in my previous post
Input file properties
FB,LRECL=80
Output file properties
FB, LRECL=86
In input file 29th position to 39th position (inclusive of 29th position to 39th positions ) if “CCCCCCCCCCC” presents then in output file from 35th position to next 6 bytes needs to be filled with CTEST1
In input file 29th position to 39th position (inclusive of 29th position to 39th positions ) if “MMMMMMMMMMM” presents then in output file from 35th position to next 6 bytes needs to be filled with MTEST1
In input file 29th position to 39th position (inclusive of 29th position to 39th positions ) if “QQQQQQQQQQQ” presents then in output file from 35th position to next 6 bytes needs to be filled with QTEST1
So on…… |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The sample data appears to have the CCC, MMM, beginning in pos 19
Far better to be accurate rather than fast |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
vicharapusrinu,
You can use a DFSORT job like the following to do what you asked for. I assumed you actually had the targets in 19-29 and used input records that matched that assumption.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAQQQQQQQQQQQ
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAMMMMMMMMMMM
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(19,11,CH,EQ,C'CCCCCCCCCCC'),
OVERLAY=(35:C'CTEST1')),
IFTHEN=(WHEN=(19,11,CH,EQ,C'MMMMMMMMMMM'),
OVERLAY=(35:C'MTEST1')),
IFTHEN=(WHEN=(19,11,CH,EQ,C'QQQQQQQQQQQ'),
OVERLAY=(35:C'QTEST1'))
/*
|
SORTOUT would have:
Code: |
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC CTEST1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACCCCCCCCCCC CTEST1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAQQQQQQQQQQQ QTEST1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAMMMMMMMMMMM MTEST1
|
|
|
Back to top |
|
|
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Frank Yaeger,
Thanks a lot for your response,
I have got one more requirement
If “CCCCCCCCCCC” is not appear from 19th position to 29th position then 6 spaces need to be moved to instead of CTEST1
...............
So on……….
please help me out |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
isn't it is happening currently by code given by Frank?
I am able to see SPACES when 19th to 29th position value is “AAAAAAAAAAA” |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
If “CCCCCCCCCCC” is not appear from 19th position to 29th position then 6 spaces need to be moved to instead of CTEST1 |
My job does leave spaces in those positions when the IFTHEN conditions are not met. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm making the assumption that you have blanks in the records at the location where CTEST1 etc goes.
If, in fact, you have something else in those positions and want to overlay it with blanks, show an example of your input records and expected output records and I'll show you how to do what you want. |
|
Back to top |
|
|
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Frank Yaeger,
Thanks a lot for your support
Here is my input and expected out put
Code: |
INPUT FILE
----+----1----+----2----+----3----+----4-
MMMMMMMMMM010000001411089156ABCD123456 A
OOOOOOOOOO010000005410918667ABCD206111 A
0120090730010000006410889243ACSONCUS2 A
0120090730010000018411081513AP00001 A
EXPECTED OUTPUT
----+----1----+----2----+----3----+----4----+----5----+----6
MMMMMMMMMM0100000014TESTM11089156ABCD123456 A
OOOOOOOOOO0100000054TESTO10918667ABCD206111 A
01200907300100000064 10889243ACSONCUS2 A
01200907300100000184 11081513AP00001 A |
Input file properties
LRECL 498, FB
Out put file properties
LRECL 503, FB
[/code] |
|
Back to top |
|
|
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Frank Yaeger/ All,
Could some one help me please?
My requirement is to insert some text in between of file
Input file LRECL = 498
Output file LRECL = 503
If in input file from 1st position to 10th position if it founds MMMMMMMMMM then in out put file TESTM should appear from 21st position and rest of input record should start from 26th position (no over writing of data)
AND
If in input file from 1st position to 10th position if it NOT founds MMMMMMMMMM then in out put file 5 SPACES should appear from 21st position and rest of input record should start from 26th position(no over writing of data)
Input and expected output lay outs are in above post…
Could some one help me please? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Be patient. I'm in California - I just got to work. If you want faster help, explain your requirements more clearly in your first post.
You might also try to figure things out yourself (I assume that's what you're being paid for). I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Here's a DFSORT job for your new requirement:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/498)
//SORTOUT DD DSN=... output file (FB/503)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(1,20,26:21,478)),
IFTHEN=(WHEN=(1,10,CH,EQ,C'MMMMMMMMMM'),
OVERLAY=(21:C'TESTM')),
IFTHEN=(WHEN=(1,10,CH,EQ,C'OOOOOOOOOO'),
OVERLAY=(21:C'TESTO'))
/*
|
|
|
Back to top |
|
|
vicharapusrinu Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 63 Location: Hyderabad
|
|
|
|
Frank Yaeger,
Thanks a lot for help, it is working fine.
I will go through document "z/OS DFSORT: Getting Started". |
|
Back to top |
|
|
|