Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Change value code to description on trailer

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

New User


Joined: 14 Apr 2009
Posts: 11
Location: Sacramento, CA

PostPosted: Mon Jul 06, 2009 8:17 pm    Post subject: Change value code to description on trailer
Reply with quote

I need to translate values to descriptions on my output trailer after creating a sectioned report.

Input:

Code:

AK01
AK02
AK01
CA02
CA02
AK01
TX01
TX20
AK01
AK01


Currently looks like this:
Code:

AK                         7
CA                         4
TX                        21


Want it to look like this:
Code:

ALASKA                     7
CALIFORNIA                 4
TEXAS                     21


Current Control Statement:
Code:

OUTFIL REMOVECC,NODETAIL,                 
 SECTIONS=(1,2,                           
 TRAILER3=(1:1,2,                         
           20:TOT=(3,2,SFF,M10,LENGTH=8)))


Thank you in advance for any help.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Mon Jul 06, 2009 9:54 pm    Post subject:
Reply with quote

kellaurin,

The following DFSORT JCL will give you the desired results.


Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
AK01                                                       
AK02                                                       
AK01                                                       
CA02                                                       
CA02                                                       
AK01                                                       
TX01                                                       
TX20                                                       
AK01                                                       
AK01                                                       
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
 SORT FIELDS=(1,2,CH,A)                                               
 OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:20X)),                           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'AL'),OVERLAY=(81:C'ALABAMA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'AK'),OVERLAY=(81:C'ALASKA')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'AS'),OVERLAY=(81:C'AMERICAN SAMOA')),       
 IFTHEN=(WHEN=(1,2,CH,EQ,C'AZ'),OVERLAY=(81:C'ARIZONA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'AR'),OVERLAY=(81:C'ARKANSAS')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'CA'),OVERLAY=(81:C'CALIFORNIA')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'CO'),OVERLAY=(81:C'COLORADO')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'CT'),OVERLAY=(81:C'CONNECTICUT')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'DE'),OVERLAY=(81:C'DELAWARE')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'DC'),OVERLAY=(81:C'DISTRICT OF COLUMBIA')),
 IFTHEN=(WHEN=(1,2,CH,EQ,C'FM'),OVERLAY=(81:C'STATES OF MICRONESIA')),
 IFTHEN=(WHEN=(1,2,CH,EQ,C'FL'),OVERLAY=(81:C'FLORIDA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'GA'),OVERLAY=(81:C'GEORGIA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'GU'),OVERLAY=(81:C'GUAM')),                 
 IFTHEN=(WHEN=(1,2,CH,EQ,C'HI'),OVERLAY=(81:C'HAWAII')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'ID'),OVERLAY=(81:C'IDAHO')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'IL'),OVERLAY=(81:C'ILLINOIS')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'IN'),OVERLAY=(81:C'INDIANA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'IA'),OVERLAY=(81:C'IOWA')),                 
 IFTHEN=(WHEN=(1,2,CH,EQ,C'KS'),OVERLAY=(81:C'KANSAS')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'KY'),OVERLAY=(81:C'KENTUCKY')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'LA'),OVERLAY=(81:C'LOUISIANA')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'ME'),OVERLAY=(81:C'MAINE')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MH'),OVERLAY=(81:C'MARSHAL ISLANDS')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MD'),OVERLAY=(81:C'MARYLAND')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MA'),OVERLAY=(81:C'MASSACHUSETTS')),       
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MI'),OVERLAY=(81:C'MICHIGAN')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MN'),OVERLAY=(81:C'MINNESOTA')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MS'),OVERLAY=(81:C'MISSISSIPPI')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MO'),OVERLAY=(81:C'MISSOURI')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MT'),OVERLAY=(81:C'MONTANA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NE'),OVERLAY=(81:C'NEBRASKA')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NV'),OVERLAY=(81:C'NEVADA')),               
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NH'),OVERLAY=(81:C'NEW HAMPSHIRE')),       
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NJ'),OVERLAY=(81:C'NEW JERSEY')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NM'),OVERLAY=(81:C'NEW MEXICO')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NY'),OVERLAY=(81:C'NEW YORK')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'NC'),OVERLAY=(81:C'NORTH CAROLINA')),   
 IFTHEN=(WHEN=(1,2,CH,EQ,C'ND'),OVERLAY=(81:C'NORTH DAKOTA')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'MP'),OVERLAY=(81:C'N MARIANA ISLANDS')),
 IFTHEN=(WHEN=(1,2,CH,EQ,C'OH'),OVERLAY=(81:C'OHIO')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'OK'),OVERLAY=(81:C'OKLAHOMA')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'OR'),OVERLAY=(81:C'OREGON')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'PW'),OVERLAY=(81:C'PALAU')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'PA'),OVERLAY=(81:C'PENNSYLVANIA')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'PR'),OVERLAY=(81:C'PUERTO RICO')),       
 IFTHEN=(WHEN=(1,2,CH,EQ,C'RI'),OVERLAY=(81:C'RHODE ISLAND')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'SC'),OVERLAY=(81:C'SOUTH CAROLINA')),   
 IFTHEN=(WHEN=(1,2,CH,EQ,C'SD'),OVERLAY=(81:C'SOUTH DAKOTA')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'TN'),OVERLAY=(81:C'TENNESSEE')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'TX'),OVERLAY=(81:C'TEXAS')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'UT'),OVERLAY=(81:C'UTAH')),             
 IFTHEN=(WHEN=(1,2,CH,EQ,C'VT'),OVERLAY=(81:C'VERMONT')),           
 IFTHEN=(WHEN=(1,2,CH,EQ,C'VI'),OVERLAY=(81:C'VIRGIN ISLANDS')),   
 IFTHEN=(WHEN=(1,2,CH,EQ,C'VA'),OVERLAY=(81:C'VIRGINIA')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'WA'),OVERLAY=(81:C'WASHINGTON')),       
 IFTHEN=(WHEN=(1,2,CH,EQ,C'WI'),OVERLAY=(81:C'WISCONSIN')),         
 IFTHEN=(WHEN=(1,2,CH,EQ,C'WV'),OVERLAY=(81:C'WEST VIRGINIA')),     
 IFTHEN=(WHEN=(1,2,CH,EQ,C'WY'),OVERLAY=(81:C'WYOMING')),           
 IFTHEN=(WHEN=NONE,OVERLAY=(81:C'WRONG STATE CODE',1,2))   
                                                                   
 OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                             
 SECTIONS=(1,2,TRAILER3=(81,20,22:TOT=(3,2,SFF,M10,LENGTH=8)))     
/*
Back to top
View user's profile Send private message
kellaurin

New User


Joined: 14 Apr 2009
Posts: 11
Location: Sacramento, CA

PostPosted: Tue Jul 07, 2009 12:33 am    Post subject:
Reply with quote

Thank you.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us