View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi,
I like to reforamt the file as follows:
Input file : kumar.infile LRECL = 95
output file : kumar.outfile LRECL = 97
The requirement is to shift the characters from 1 to 95 (in input file) to
positions 3 to 97 (in output file) and needs to insert '1C8' IN hexa format at the first 2 positions. |
|
Back to top |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
Hi
Please find sample JCL below
//SORT#01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=HLQ.RECL.#95,DISP=SHR
//SORTOUT DD DSN=HLQ.RECL.#97,DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,95,CH,A)
INREC FIELDS=(1,95)
OUTREC FIELDS=(C'AA',3:1,95)
/*
Instead of C'AA', you can substitute the string u want...Hope this helps...
Regards
Sowmya Sridhar |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sowmya,
Quote: |
INREC FIELDS=(1,95)
OUTREC FIELDS=(C'AA',3:1,95) |
Did you read the original post properly? M K K wants to insert HEXA string not CHAR?
Also why had you provided INREC? Even iwthout inrec statement, the control card has same effect. |
|
Back to top |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
Quote: |
needs to insert '1C8' IN hexa format at the first 2 positions.
|
I dont understand how 3 characters can be put in first 2 positions...Also C'AA' can be substituted as X'value'. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sowmya,
Also,
Quote: |
SORT FIELDS=(1,95,CH,A) |
Doesn't this alter the record sequence? |
|
Back to top |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
It does..Sorry..
Quote: |
SORT FIELDS=(1,95,CH,A) |
Can be substituted as
If you dont want to sort the records... |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Thanks all,
Its working fine now. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
M K K,
You can use these DFSORT statements:
Code: |
OPTION COPY
INREC BUILD=(X'hhhh',1,95)
|
where X'hhhh' is the hexadecimal string you need.
If you're not familiar with DFSORT and DFSORT's ICETOOL, 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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|