Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to reformat the File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Sep 14, 2007 12:12 pm    Post subject: Need to reformat the File
Reply with quote

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
View user's profile Send private message

ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:15 pm    Post subject: Reply to: Need to reformat the File using the JCL
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Sep 14, 2007 2:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Sep 14, 2007 2:34 pm    Post subject:
Reply with quote

Sowmya,

Also,

Quote:
SORT FIELDS=(1,95,CH,A)


Doesn't this alter the record sequence?
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:39 pm    Post subject:
Reply with quote

It does..Sorry..

Quote:
SORT FIELDS=(1,95,CH,A)

Can be substituted as
Quote:
SORT FIELDS=COPY

If you dont want to sort the records...
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Sep 14, 2007 4:31 pm    Post subject: Reply to: Need to reformat the File using the JCL
Reply with quote

Thanks all,

Its working fine now.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 14, 2007 8:24 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 4 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us