I have DATE filed like DD-MM-YYYY, So I want output should be
MM/DD/YYYY using JCL?

Can anybody post the answer for above requirement?




Answers were Sorted based on User's Feedback



I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / harsha

12345678910
DD-MM-YYYY
Above is the date and column numbers.

//STEP1 EXEC PGM=SORT
// .
// .
// .
OPTION COPY
OUTFILE FNAMES=SORTOUT
OUTREC=(4,2,C'/',1,2,C'/',7,4)

Is This Answer Correct ?    14 Yes 1 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / mfgan

When DD-MM-YYYY is the first field of input record,
Then use the below code,

//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,2,
3:C'/',
4:4,2,
6:C'/',
7:7,4)
/*
//
When others,
Change the position numbers occordingly.

Is This Answer Correct ?    2 Yes 0 No

I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / raghuvanshi

When I am using
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)
/*
//

I am getting the same output as input!
Can someone please through some light on it.

Is This Answer Correct ?    1 Yes 1 No




I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody..

Answer / pranay

OUTREC FIELDS=(4,2,C'/',1,2,C'/',7,4)

The above Sort card is working perfectly fine for me.
Please recheck.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More JCL Interview Questions

Explain about CBL/PROCESS statement syntax

1 Answers  


In JCL..for TIME Parameter was specified both JOB & STEP..which one is overrides

6 Answers   Satyam,


common jcl abends??

2 Answers   ADP, Wipro,


how to run JCL thru COBOL.

1 Answers   Patni,


What are the keywords associated with DCB? How can you specify DCB information? What is the OS precedence for obtaining that DCB information, ie. where does the system look for it first?

2 Answers  






what is the difference between static call and dynamic call?

1 Answers  


I have 2 steps in my exec statement , in first step I am creating a gdg, and the output of this step is going into second step as a input, and this second step is abended , now how could i approach in this case.

5 Answers   Bank Of America,


Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP 2. empname - X(20) 3. empsal - S9(5)V(2) COMP-3 If I view this file, it will not be in a readable format. How to display the empid and empsal fields in a readable format without using COBOL program? What kind of SORT card will have to be coded?

4 Answers  


We have two PS files,want to compare those files and put the duplicate records in one file. Input file 1 contains(1,2,4,9,10) Input file 2 contains (1,4,5,11,12,14,16). Help me with jcl.

6 Answers  


what r the types of job control statements?

2 Answers  


What is the difference between primary and secondary allocations for a dataset?

8 Answers  


What is the purpose of dd * statement in jcl?

0 Answers  






Categories