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
 
Reformatting of O/P file based on I/P value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:09 pm    Post subject: Reformatting of O/P file based on I/P value
Reply with quote

I have an I/P file like following :

1CNCLABC123
2DCHGBCD456
3CNCLABC456
4DCHGBCD123

Layout :
1st byte = Sequence no
2-5 byte = Category
6-8 byte = Code1
9-11 byte = Code2

Requirement:
O/P file should contain only Category and Code, total 7 bytes in length.
If category = 'CNCL' ------> then code = Code1 (6-8 byte)
If Category = 'DCHG' -----> then code = Code2 (9-11 byte).

Please help me to do this one using SORT utility.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 10, 2010 11:14 pm    Post subject: Reply to: Reformatting of O/P file based on I/P value
Reply with quote

Debasis Misra,

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
1CNCLABC123                                       
2DCHGBCD456                                       
3CNCLABC456                                       
4DCHGBCD123                                       
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *
  INCLUDE COND=(2,4,SS,EQ,C'CNCL,DCHG')                                     
  SORT FIELDS=COPY                                 
  INREC IFOUTLEN=7,                               
  IFTHEN=(WHEN=(2,4,CH,EQ,C'CNCL'),BUILD=(2,7)),   
  IFTHEN=(WHEN=(2,4,CH,EQ,C'DCHG'),BUILD=(2,4,9,3))
//*                                               
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:24 pm    Post subject:
Reply with quote

Thanks a lot!, its working, I have tried now.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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