IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to create control card using flag from i/p file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Aug 29, 2007 5:58 pm
Reply with quote

Hi,

I want to create two separate control cards using a flag(6th position) in the Input File using DFSORT/ICETOOL. Is this possible?

Sample Input Data:
---------------------
00020L
00020R

Requirement:
--------------
IF the flag = 'L' THEN output control card should look like

LOAD DATA
RESUME YES
INTO TABLE
PART
00020(this is the 1st 5 bytes from the input file)
TABLE STRUCTURE

IF the flag = 'R' THEN output control card should look like

LOAD DATA
RESUME YES
INTO TABLE
PART
00020(this is the 1st 5 bytes from the input file)
REPLACE
TABLE STRUCTURE

Please let me know if this can be done.

Thanks
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 6:25 pm
Reply with quote

Code:
// EXEC PGM=SORT                                 
//SORTIN DD *                                     
00020L                                           
00020R                                           
/*                                               
//SORTOUT DD SYSOUT=*                             
//SYSOUT DD SYSOUT=*                             
//SYSIN DD *                                     
 OPTION COPY                                     
 OUTFIL IFOUTLEN=80,                             
        IFTHEN=(WHEN=(6,1,CH,EQ,C'L'),           
              BUILD=(C'LOAD DATA',/,             
                     C'RESUME YES',/,             
                     C'INTO TABLE',/,             
                     C'PART',/,                   
                     1,5,/,                       
                     C'TABLE STRUCTURE')),       
       IFTHEN=(WHEN=(6,1,CH,EQ,C'R'),             
              BUILD=(C'LOAD DATA',/,             
                     C'RESUME YES',/,         
                     C'INTO TABLE',/,         
                     C'PART',/,               
                     1,5,/,                   
                     C'REPLACE',/,             
                     C'TABLE STRUCTURE'))     
/*                                             
//

Output:
Code:
LOAD DATA       
RESUME YES     
INTO TABLE     
PART           
00020           
TABLE STRUCTURE
LOAD DATA       
RESUME YES     
INTO TABLE     
PART           
00020           
REPLACE         
TABLE STRUCTURE
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Aug 29, 2007 10:36 pm
Reply with quote

Thanks Shankar,

i can try this 2mrw, just one question .. i hope i can give input file also where you have specified the input data DD statement SORTIN

// EXEC PGM=SORT
//SORTIN DD *
00020L
00020R
/*

//SORTIN DD DSN=INPUT.FILE,DISP=SHR


Regards
Manpreet
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 29, 2007 11:39 pm
Reply with quote

Hello,

Yes, you can use a file as input.
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Thu Aug 30, 2007 10:20 am
Reply with quote

Thanks Shankar & Dick Scherrer,

Sort is working fine. Appreciate all your help.

Thanks & Regards
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top