-
Notifications
You must be signed in to change notification settings - Fork 0
/
nme-margin-calculation.sas
3808 lines (3244 loc) · 173 KB
/
nme-margin-calculation.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*--------------------------------------------------------------*/
/* ANTIDUMPING NON-MARKET ECONOMY */
/* MARGIN CALCULATION PROGRAM */
/* */
/* GENERIC VERSION LAST UPDATED AUGUST 13, 2024 */
/* */
/* PART 1: IDENTIFY DATA, VARIABLES, AND PARAMETERS */
/* PART 2: GET U.S., FOP, AND SV DATA */
/* PART 3: KEEP U.S. SALES INSIDE THE COURSE OF ORDINARY */
/* TRADE */
/* PART 4: ADD SURROGATE VALUES TO U.S. SALES */
/* PART 5: MATCH U.S. SALES AND SV DATA TO FOP DATA */
/* PART 6: CONVERT VARIABLES INTO U.S. DOLLARS AND REVISE */
/* THE VARIABLE NAMES TO INCLUDE THE SUFFIX _USD */
/* (USING DOC EXCHANGE RATES) */
/* PART 7: CALCULATE INPUTS */
/* PART 8: CALCULATE NORMAL VALUES */
/* PART 9A: CALCULATE NET U.S. PRICE FOR EP SALES */
/* PART 9B: CALCULATE NET U.S. PRICE FOR CEP SALES */
/* PART 10: CBP ENTERED VALUE BY IMPORTER */
/* PART 11: COHEN'S-D TEST */
/* PART 12: WEIGHT AVERAGE U.S. SALES */
/* PART 13: COMPARISON RESULTS */
/* PART 14: CORROBORATE THE PETITION RATE */
/* PART 15: PRINT SAMPLES OF HIGHEST AND LOWEST COMPARISON */
/* RESULTS */
/* PART 16: CASH DEPOSIT RATES */
/* PART 17: MEANINGFUL DIFFERENCE TEST */
/* PART 18: IMPORTER-SPECIFIC DUTY ASSESSMENT RATES */
/* (REVIEWS ONLY) */
/* PART 19: REPRINT THE FINAL CASH DEPOSIT RATE */
/* PART 20: REVIEW LOG FOR ERRORS, WARNINGS, UNINIT., ETC. */
/*--------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* EDITING THE PROGRAM: */
/* */
/* Places requiring edits are indicated by angle brackets (i.e., '< >'). */
/* Replace angle brackets with case-specific information. */
/* */
/* Types of Inputs: (D) = SAS dataset name */
/* (V) = Variable name */
/* (T) = Text (no specific format), */
/* do NOT use punctuation marks */
/* */
/* If there are angle brackets that are commented out, replacing the */
/* angles brackets with case specific code is optional. For example: */
/* */
/* <Insert changes here, if required.> */
/*-----------------------------------------------------------------------*/
/*--------------------------------------------------------------*/
/* EXECUTING/RUNNING THE PROGRAM: */
/* */
/* In addition to executing the entire program, you can do */
/* partial runs. Executable points from which you can */
/* partially run the program are indicated by /*ep* on */
/* the left margin. To do a partial run, just highlight the */
/* program from one of the executable points to the top, */
/* then submit it. */
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
/* LOCATION OF DATA AND MACROS PROGRAM */
/* */
/* LIBNAME = The name (i.e., COMPANY) and location of the */
/* sub-directory containing the SAS datasets for */
/* this program. */
/* EXAMPLE: E:\Operations\India\CORE\INV */
/* */
/* FILENAME = Full path of the Macro Program for this case, */
/* consisting of the sub-directory containing the */
/* Macro Program and its file name. */
/*--------------------------------------------------------------*/
LIBNAME COMPANY '<E:\....>'; /*(T) Location of company and */
/* exchange rate data sets. */
FILENAME C_MACS '<E:\...\Common Macros.sas>'; /*(T) Location & Name of the */
/* Common Macros Program */
%INCLUDE C_MACS; /* Use the Common Macros */
/* Program. */
%LET LOG_SUMMARY = YES; /*(T) Default value is "YES" (no */
/* quotes). Use "NO" (no quotes) */
/* to run program in parts for */
/* troubleshooting. */
/*--------------------------------------------*/
/* GET PROGRAM PATH/NAME AND CREATE THE SAME */
/* NAME FOR THE LOG FILE WITH .LOG EXTENSION. */
/*--------------------------------------------*/
%GLOBAL MNAME LOG;
%LET MNAME = %SYSFUNC(SCAN(%SYSFUNC(pathname(C_MACS)), 1, '.'));
%LET LOG = %SYSFUNC(substr(&MNAME, 1, %SYSFUNC(length(&MNAME)) - %SYSFUNC(indexc(%SYSFUNC(
reverse(%SYSFUNC(trim(&MNAME)))), '\'))))%STR(\)%SYSFUNC(DEQUOTE(&_CLIENTTASKLABEL.))%STR(.log);
%CMAC1_WRITE_LOG;
/*--------------------------------------------------*/
/* PART 1: IDENTIFY DATA, VARIABLES, AND PARAMETERS */
/*--------------------------------------------------*/
/* TYPE IN EITHER THE WORD 'AR' (NOT 1ST REVIEW) */
/* OR THE WORD 'INV'. DO NOT TYPE THE QUOTES. */
%LET CASE_TYPE = <INV/AR>; /*(T) For an investigation, type 'INV' (without quotes) */
/* For an administrative review, type 'AR' (without quotes) */
/*------------------------------------------*/
/* TYPE IN THE CASE NUMBER (EX. A-357-812). */
/*------------------------------------------*/
%LET CASE_NUMBER = < >; /*(T) Case Number */
/*-------------------------*/
/* TYPE IN YOUR FULL NAME. */
/*-------------------------*/
%LET PROGRAMMER = < >; /*(T) Case Analyst responsible for programming */
/*--------------------------------------------------------------*/
/* TYPE IN THE NAMES OF THE U.S. AND FOP DATASETS. THIS PROGRAM */
/* ASSUMES THAT BOTH SOURCES OF DATA ARE ALREADY STORED AS SAS */
/* DATSETS. IF THEY ARE NOT, CONVERT THEM TO SAS DATASETS */
/* BEFORE RUNNING THIS PROGRAM. DO NOT USE THE FILE NAME */
/* EXTENSION. (EX. USSALES, *NOT* USSALES.SAS7BDAT.) */
/*--------------------------------------------------------------*/
%LET USDATA = < >; /*(D) NAME OF U.S. DATASET */
%LET FOPDATA = < >; /*(D) NAME OF FOP DATASET */
/*------------------------------------------------------------*/
/* THE FOLLOWING FIVE MACRO VARIABLES ARE USED TO CONVERT THE */
/* SURROGATE VALUE DATA, STORED AS A SPREADSHEET, INTO A SAS */
/* DATASET. USE THE SV COMPANY SPECIFIC SUMMARY SHEET. */
/* */
/* NOTE: VARIABLE NAMES USED IN SPREAD SHEETS NEED TO FOLLOW */
/* THE NAMING CONVENTIONS OF SAS VARIABLE NAMES. VARIABLES */
/* CAN BE MADE UP OF LETTERS, NUMBERS, AND THE UNDERSCORE */
/* CHARACTER "_" AND CAN BE UP TO 32 CHARACTERS LONG. A SAS */
/* NAME CANNOT START WITH A NUMBER. */
/*------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* THE MACRO VARIABLE 'SV_PATH' IS USED TO IDENTIFY THE LOCATION AND */
/* NAME OF THE OF THE SURROGATE VALUE DATASET. */
/* */
/* EXAMPLE: E:\Operations\Peoples Republic Of China\HEDP\2015 INV\SV.xls */
/*-----------------------------------------------------------------------*/
%LET SV_PATH = < >; /*(T) WINDOWS EXPLORER LOCATION AND FILE */
/* NAME (INCLUDING THE FILE EXTENSION). */
/*-----------------------------------------------------------------------*/
/* THE MACRO VARIABLES 'SV_NAME_RANGE' AND 'SV_VALUE_RANGE' ARE USED */
/* TO IDENTIFY WORKBOOK AND CELL RANGE ON THE SURROGATE VARIABLE */
/* NAMES AND SURROGATE VARIABLE VALUES RESPECTIVLY. */
/* */
/* EXAMPLES: SV DATA$R3:R15 AND SV DATA$T3:T15 */
/*-----------------------------------------------------------------------*/
%LET SV_NAME_RANGE = < >; /*(T) WORKSHEET NAME AND COLUMN RANGE */
/* SEPARATED BY DOLLAR SIGN ($). */
/* COLUMN RANGE REPRESENTS SURROGATE */
/* VALUE VARIABLE NAMES. USE THE SYNTAX: */
/* NAMEOFTHESHEET$COLUMNRANGE. */
/* EXAMPLE: SummaryofSVs$O6:O34 */
%LET SV_VALUE_RANGE = < >; /*(T) WORKSHEET NAME AND COLUMN RANGE */
/* SEPARATED BY DOLLAR SIGN ($). */
/* COLUMN RANGE REPRESENTS SURROGATE */
/* VALUE VARIABLE VALUES. USE THE SYNTAX: */
/* NAMEOFTHESHEET$COLUMNRANGE. */
/* EXAMPLE: SummaryofSVs$P6:P34 */
/*-----------------------------------------------------------------------*/
/* THE MACRO VARIABLES 'SV_VAR_NAMES_COLUMN_LETTER' AND */
/* 'SV_VAR_VALUES_COLUMN_LETTER' ARE USED TO IDENTIFY WORKBOOK AND CELL */
/* COLUMN NUMBERS. */
/* */
/* EXAMPLES: R AND T */
/*-----------------------------------------------------------------------*/
%LET SV_VAR_NAMES_LABEL = < >; /*(T) SURROGATE VALUE NAME COLUMN */
/* NAME. EXAMPLE: R */
%LET SV_VAR_VALUES_LABEL = < >; /*(T) SURROGATE VALUE NAME COLUMN */
/* NAME. EXAMPLE: T */
/*--------------------------------------------------------------------*/
/* DATE INFORMATION */
/* */
/* Dates should be written in SAS DATE9 format (e.g., 01JAN2020). */
/* */
/* USSALEDATE: */
/* */
/* The date of sale variable defined by the macro variable */
/* USSALEDATE will be used to capture all U.S. sales within the date */
/* range specified by the macro variables USBEGINDAY and USENDAY. */
/* */
/* USDATEBEFORESALE and USEARLIERDATE: */
/* */
/* If there are reported dates before the sale date and you want */
/* the earlier dates to be assigned to sale date, define the macro */
/* variable USDATEBEFORESALE to 'YES' and assign the variable with */
/* earlier dates to the macro variable USEARLIERDATE (ex. SHIPDATU). */
/* Otherwise define the macro variable USDATEBEFORESALE to 'NO' and */
/* ignore the macro variable USEARLIERDATE. */
/* */
/* USBEGINDAY and USENDDAY: */
/* */
/* Define the macro variables USBEGINDAY and USENDDAY to correspond */
/* to the universe of U.S. sales that you want to use. */
/* */
/* For Investigations USBEGINDAY often corresponds to the first day */
/* of the first month of the period and USENDDAY often corresponds to */
/* the last day of the last month of the period, respectively, */
/* covering all U.S. sales dates. */
/*--------------------------------------------------------------------*/
%LET USSALEDATE = < >; /* (V) Variable representing the */
/* U.S. sale date. */
%LET USDATEBEFORESALE = <YES/NO>; /* (T) Adjust sale date based on */
/* an earlier date variable? */
/* Type 'YES' (no quotes) to */
/* adjust the sale date, or */
/* 'NO' to skip this part. */
/* If you typed 'YES' then */
/* also complete the macro */
/* variable USEARLIERDATE. */
%LET USEARLIERDATE = < >; /* (V) Variable representing the */
/* earlier date variable. */
%LET USBEGINDAY = <DDMONYYYY>; /* (T) Please see above DATE */
/* INFORMATION for guidance. */
%LET USENDDAY = <DDMONYYYY>; /* (T) Please see above DATE */
/* INFORMATION for guidance. */
/*--------------------------------------------------------------*/
/* ADDITIONAL FILTERING OF U.S. SALES, IF REQUIRED */
/* */
/* Should you additionally wish to filter U.S. sales using */
/* different dates and/or date variables for CEP v EP sales, */
/* complete the following section. This may be useful when */
/* you have both EP and CEP sales in an administrative review. */
/* In reviews, reported CEP sales usually include all sales */
/* during the POR. For EP sales in reviews, reported sales */
/* usually include all entries during the POR. To filter EP */
/* sales by entry date, for example, you would put the first */
/* and last days of the POR for BEGINDAY_EP and ENDDAY_EP, and */
/* the variable for date of entry under EP_DATE_VAR. */
/*--------------------------------------------------------------*/
%LET FILTER_CEP = <YES/NO>; /*(T) Additionally filter CEP sales? */
/* Type "YES" (no quotes) to */
/* filter, "NO" to skip this part. */
/* If you typed "YES," then also */
/* complete the three subsequent */
/* indented macro variables. */
%LET CEP_DATE_VAR = < >; /*(V) The date variable to be used to */
/* filter CEP sales */
%LET BEGINDAY_CEP = <DDMONYYYY>; /*(T) Day 1 of 1st month of CEP U.S. */
/* sales to be kept. */
%LET ENDDAY_CEP = <DDMONYYYY>; /*(T) Last day of last month of CEP */
/* U.S. sales to be kept. */
%LET FILTER_EP = <YES/NO>; /*(T) Additionally filter EP sales? */
/* Type "YES" (no quotes) to */
/* filter, "NO" to skip this part. */
/* If you typed "YES," then also */
/* complete the three subsequent */
/* indented macro variables. */
%LET EP_DATE_VAR = < >; /*(V) The date variable to be used to */
/* filter EP sales, such as, */
/* entry date. */
%LET BEGINDAY_EP = <DDMONYYYY>; /*(T) Day 1 of 1st month of EP U.S. */
/* sales to be kept. */
%LET ENDDAY_EP = <DDMONYYYY>; /*(T) Last day of last month of EP */
/* U.S. sales to be kept. */
/*-------------------------------------------------------------------------*/
/* TITLES, FOOTNOTES AND AUTOMATIC NAMES FOR OUTPUT DATASETS */
/* */
/* The information below will be used in creating titles, footnotes */
/* and the names of output datasets for later use in the U.S. Sales */
/* Margin Program. */
/* */
/* NAMES FOR OUTPUT DATASETS: */
/* */
/* Names of all output datasets generated by this program will have a */
/* standardized prefix using the format: "RESPONDENT_SEGMENT_STAGE" */
/* in which: */
/* */
/* RESPONDENT = Respondent identifier (e.g., company name) */
/* SEGMENT = Segment of proceeding (e.g., INVEST, AR6, REMAND) */
/* STAGE = PRELIM or FINAL */
/* */
/* The total number of places/digits used in the RESPONDENT, SEGMENT */
/* and STAGE identifiers, combined, should NOT exceed 21. Letters, */
/* numbers and underscores are acceptable. No punctuation marks, */
/* blank spaces or special characters should be used. */
/* */
/* The names of the output datasets this program creates, where */
/* applicable, are the following: */
/* */
/* {RESPONDENT_SEGMENT_STAGE}_COST = Wt-avg costs */
/* {RESPONDENT_SEGMENT_STAGE}_HMCEP = HM revenue/expenses for */
/* CEP profit */
/* {RESPONDENT_SEGMENT_STAGE}_CVSELL = Selling & profit ratios */
/* for CV */
/* {RESPONDENT_SEGMENT_STAGE}_HMWTAV = Wt-avg HM data */
/* {RESPONDENT_SEGMENT_STAGE}_LOTADJ = LOT adjustment factors */
/* */
/* All output datasets will be placed in the COMPANY directory. */
/*-------------------------------------------------------------------------*/
%LET PRODUCT = %NRBQUOTE(<Product under Investigation or Review>); /*(T) Product */
%LET COUNTRY = %NRBQUOTE(<Country under Investigation or Review>); /*(T) Country */
/*-------------------------------------------------------------------------*/
/* The macro variables BEGINPERIOD and ENDPERIOD refer to the beginning */
/* and at the end of the official POI/POR. They are used for titling. */
/* BEGINPERIOD is also used in the Cohens d Test. */
/* */
/* Typically, these dates refer to the first day of the first month for */
/* the POI/POR for the BEGINPERIOD and the last day of the last month of */
/* the POI/POR for the ENDPERIOD. However, for first administrative */
/* reviews BEGINPERIOD is dependent on the injury results of the */
/* International Trade Commission (ITC) and the first day of suspension of */
/* liquidation. Please confirm the BEGINPERIOD with the Federal Register */
/* Notice initiating the first administrative review. */
/*-------------------------------------------------------------------------*/
%LET BEGINPERIOD = <DDMONYYYY>; /* (T) First day of the official POI/POR. */
%LET ENDPERIOD = <DDMONYYYY>; /* (T) Last day of the official POI/POR. */
/*------------------------------------------------------------------------*/
/* Between the RESPONDENT, SEGMENT and STAGE macro variables below, there */
/* should be a maximum of 21 digits. */
/*------------------------------------------------------------------------*/
%LET RESPONDENT = < >; /*(T) Respondent identifier. Use only letters, numbers */
/* and underscores. No punctuation marks, blank */
/* spaces or special characters should be used. */
%LET SEGMENT = < >; /*(T) Segment of the proceeding, e.g., Invest, AR1, */
/* Remand. Use only letters, numbers and underscores */
/* No punctuation marks, blank spaces or special */
/* characters should be used. */
%LET STAGE = < >; /*(T) Stage of proceeding, e.g., Prelim, Final, Remand. */
/* Use only letters, numbers and underscores. No */
/* punctuation marks, blank spaces or special */
/* characters should be used. */
/*---------------------------------------------------------*/
/* HAVE CONTROL NUMBERS (I.E. CONNUMU) BEEN REPORTED FOR */
/* THIS CASE? TYPE IN 'YES' IF CONTROL NUMBERS HAVE BEEN */
/* REPORTED FOR THIS CASE. TYPE IN 'NO' IF CONTROL NUMBERS */
/* HAVE NOT BEEN REPORTED FOR THIS CASE. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*---------------------------------------------------------*/
%LET CONNUMS = <YES/NO>; /*(T) TYPE IN 'YES' OR 'NO'. */
/* DO NOT TYPE THE QUOTES. */
/*-----------------------------------------------------------------*/
/* IF THERE ARE REPORTED CONTROL NUMBERS, TYPE IN THE U.S. AND FOP */
/* CONTROL VARIABLE NAMES. IF THERE ARE NO CONTROL NUMBERS FOR */
/* THIS CASE, DO NOT FILL IN THE FOLLOWING TWO MACRO VARIABLE. */
/*-----------------------------------------------------------------*/
%LET USCONNUM = < >; /*(V) TYPE IN THE U.S. CONTROL VARIABLE */
/* NAME (EX. CONNUMU) IF CONTROL */
/* NUMBERS HAVE BEEN REPORTED. */
%LET FOPCONNUM = < >; /*(V) TYPE IN THE FOP CONTROL VARIABLE */
/* NAME (EX. CONNUM) IF CONTROL */
/* NUMBERS HAVE BEEN REPORTED. */
/*------------------------------------------------------------*/
/* IF THERE ARE REPORTED CONTROL NUMBERS (I.E. CONNUMU), LIST */
/* THE PHYSICAL CHARACTERISTIC VARIABLES THAT DEFINE THE */
/* CONTROL NUMBERS. SEPARATE THE VARIABLES WITH SPACES. */
/* OTHERWISE, LEAVE THIS MACRO VARIABLE BLANK. */
/*------------------------------------------------------------*/
%LET USPHVARS = < >; /*(V) PRODUCT MATCHING CHARACTERISTICS. LIST */
/* THEM FROM LEFT TO RIGHT IN ORDER OF */
/* IMPORTANCE, WITH SPACES SEPARATING THEM. */
/* DO NOT SURROUND THE VALUES WITH QUOTES. */
/*-----------------------------------------------------------*/
/* WERE PHYSICAL CHARACTERISTICS INCLUDED WITH THE FOP DATA? */
/* TYPE IN 'YES' IF PHYSICAL CHARACTERISTICS WERE REPORTED */
/* WITH THE FOP DATA AND 'NO' IF THEY WERE NOT REPORTED. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*-----------------------------------------------------------*/
%LET FOPCHARS = <YES/NO>; /*(T) TYPE IN 'YES' OR 'NO'. */
/* DO NOT TYPE THE QUOTES. */
/*----------------------------------------------------------------*/
/* TYPE IN THE U.S. GROSS UNIT PRICE VARIABLE NAME (EX. GRSUPRU). */
/*----------------------------------------------------------------*/
%LET USGUP = < >; /*(V) TYPE IN THE GROSS UNIT PRICE */
/* VARIABLE NAME (EX. GRSUPRU). */
/*-----------------------------------------------------*/
/* TYPE IN THE U.S. QUANTITY VARIABLE NAME (EX. QTYU). */
/*-----------------------------------------------------*/
%LET USQTY = < >; /*(V) TYPE IN THE U.S. QUANTITY */
/* VARIABLE NAME (EX. QTYU). */
/*-------------------------------------------------------------*/
/* TYPE IN 'EP' IF SALES ARE ONLY EXPORT PRICE SALES, 'CEP' IF */
/* SALES ARE CONSTRUCTED EXPORT PRICE OR FURTHER MANUFACTURED */
/* SALES OR 'BOTH' IF SALES ARE OF A MIXED TYPE. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*-------------------------------------------------------------*/
%LET SALETYPE = <EP/CEP/BOTH>; /*(T) TYPE IN 'EP', 'CEP', OR 'BOTH'. */
/* DO NOT TYPE THE QUOTES. */
/*-------------------------------------------------------------------*/
/* CASES INITIATED AFTER JUNE 19, 2012 MAY HAVE IRRECOVERABLE INPUT */
/* VALUE-ADDED TAXES (VATTAXU) ON MERCHANDISE SOLD TO THE UNITED */
/* STATES AND THOSE TAXES ARE DEDUCTED FROM THE EP OR CEP PRICES. */
/* DEFINE THE MACRO VARIABLE VAT_TAX_TYPE TO CAPTURE WHETHER VATTAXU */
/* IS REPORTED AS A UNIT AMOUNT, AS A PERCENTAGE, OR NOT REPORTED. */
/*-------------------------------------------------------------------*/
%LET VAT_TAX_TYPE = <AMOUNT/PERCENTAGE/NONE>; /*(T) TYPE IN 'AMOUNT' IF VATTAXU IS REPORTED */
/* AS A UNIT AMOUNT. TYPE IN 'PERCENTAGE' */
/* IF VATTAXU IS REPORTED AS A PERCENTAGE. */
/* TYPE IN 'NONE' IF THERE IS NO VATTAXU. */
/* DO NOT TYPE THE QUOTES. */
/*--------------------------------------------------------------------*/
/* CASES INITIATED AFTER JUNE 19, 2012 MAY HAVE EXPORT OR OTHER TAXES */
/* (EXTAXU) PAID ON MERCHANDISE SOLD TO THE UNITED STATES AND THOSE */
/* TAXES ARE DEDUCTED FROM THE EP OR CEP PRICES. DEFINE THE MACRO */
/* VARIABLE EXPORT_TAX_TYPE TO CAPTURE WHETHER EXTAXU IS REPORTED */
/* AS A UNIT AMOUNT, AS A PERCENTAGE, OR NOT REPORTED. */
/*--------------------------------------------------------------------*/
%LET EXPORT_TAX_TYPE = <AMOUNT/PERCENTAGE/NONE>; /*(T) TYPE IN 'AMOUNT' IF EXTAXU IS REPORTED */
/* AS A UNIT AMOUNT. TYPE IN 'PERCENTAGE' */
/* IF EXTAXU IS REPORTED AS A PERCENTAGE. */
/* TYPE 'NONE' IF THERE IS NO EXTAXU. */
/* DO NOT TYPE THE QUOTES. */
/*-------------------------------------------------------*/
/* TO CORROBORATE THE PETITION RATE, INITIATION RATE, OR */
/* HIGHEST RATE. TYPE IN THE RATE AS A PERCENTAGE VALUE */
/* (EX. 93.13, WHICH STANDS FOR A RATE OF 93.13%). */
/*-------------------------------------------------------*/
%LET PERCENT = < >; /*(T) TYPE IN THE PETITION RATE, INITIATION RATE, */
/* OR HIGHEST RATE. TYPE IN THE PERCENTAGE AS */
/* A FRACTIONAL VALUE (EX. 93.13 WHICH STANDS */
/* FOR 93.13%). */
/*----------------------------------------------------------*/
/* DISPLAY THE ANTIDUMPING DUTY MARGIN AS A PER-UNIT AMOUNT */
/* INSTEAD OF A WEIGHT AVERAGED PERCENT MARGIN? */
/* */
/* TYPE IN 'YES' TO DISPLAY THE ANTIDUMPING DUTY MARGIN AS */
/* A PER-UNIT AMOUNT INSTEAD OF A WEIGHT AVERAGED */
/* PERCENT MARGIN. OTHERWISE, TYPE IN A 'NO'. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*----------------------------------------------------------*/
%LET PER_UNIT_RATE = <YES/NO>; /*(T) TYPE IN 'YES' OR 'NO'. */
/* DO NOT TYPE THE QUOTES. */
/*------------------------------------------------------*/
/* FOR REVIEWS, TYPE IN THE 'IMPORTER' IF IMPORTER IS */
/* REPORTED OR 'CUSCODU' IF IMPORTER IS NOT REPORTED. */
/* TYPE IN 'YES' IF ENTERED VALUE IS REPORTED AND 'NO' */
/* IF ENTERED VALUE IS NOT REPORTED. */
/* */
/* FOR INVESTIGATIONS, DO NOT FILL IN THESE VARIABLES. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*------------------------------------------------------*/
%LET IMPORTER = <IMPORTER/CUSCODU>; /*(V) TYPE IN 'IMPORTER' OR */
/* 'CUSCODU'. DO NOT TYPE */
/* THE QUOTES. */
%LET ENTERED_VALUE = <YES/NO>; /*(V) TYPE IN 'YES' OR 'NO'. */
/* DO NOT TYPE THE QUOTES. */
/*------------------------------------------------------------*/
/* DISPLAY THE IMPORTER-SPECIFIC MARGINS AS A PER-UNIT AMOUNT */
/* REGARDLESS OF WHETHER ENTERED VALUE IS REPORTED? */
/* */
/* TYPE IN 'YES' TO DISPLAY THE IMPORTER-SPECIFIC MARGINS AS */
/* A PER-UNIT AMOUNT REGARDLESS OF WHETHER ENTERED VALUE IS */
/* REPORTED? OTHERWISE, TYPE IN A 'NO'. */
/* */
/* DO NOT TYPE IN THE QUOTES. */
/*------------------------------------------------------------*/
%LET FORCEPERUNITASSESS = <YES/NO>; /*(T) TYPE IN 'YES' OR 'NO'. */
/* DO NOT TYPE THE QUOTES. */
/*----------------------------------------------------------------------------------*/
/* IF THERE ARE ANY ADJUSTMENTS THAT NEED TO BE CONVERTED INTO U.S. DOLLARS, MAKE */
/* A COPY OF THE DAILY EXCHANGE RATE DATASET(S) FROM: */
/* */
/* E:\Boilerplate SAS Programs and Exchange Rates\Exchange Rates */
/* */
/* AND PUT THE COPY (OR COPIES) IN THE LOCATION WHERE THE SAS DATASETS (EX. U.S. */
/* SALES, FOP) FOR THIS CASE ARE LOCATED. */
/*----------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* FILL OUT THE FOLLOWING THREE MACRO VARIABLES IF THERE ARE ADJUSTMENTS */
/* THAT NEED TO BE CONVERTED INTO U.S. DOLLARS FROM A FIRST FOREIGN CURRENCY. */
/* OTHERWISE FILL OUT ONLY THE FIRST MACRO VARIABLE USE_EXRATES1. */
/*----------------------------------------------------------------------------*/
%LET USE_EXRATES1 = <YES/NO>; /*(T) Use exchange rate #1? Type "YES" or "NO" */
/* (without quotes). */
%LET EXDATA1 = < >; /*(D) Exchange rate #1 dataset name. */
%LET VARS_TO_USD1 = < >; /*(V) Type in the list of variables to convert */
/* into U.S. dollars using exchange rate #1. */
/* Separate the variables with spaces. */
/*-----------------------------------------------------------------------------*/
/* FILL OUT THE FOLLOWING THREE MACRO VARIABLES IF THERE ARE ADJUSTMENTS */
/* THAT NEED TO BE CONVERTED INTO U.S. DOLLARS FROM A SECOND FOREIGN CURRENCY. */
/* OTHERWISE FILL OUT ONLY THE FIRST MACRO VARIABLE USE_EXRATES2. */
/*-----------------------------------------------------------------------------*/
%LET USE_EXRATES2 = <YES/NO>; /*(T) Use exchange rate #2? Type "YES" or "NO" */
/* (without quotes). */
%LET EXDATA2 = < >; /*(D) Exchange rate #2 dataset name. */
%LET VARS_TO_USD2 = < >; /*(V) Type in the list of variables to convert */
/* into U.S. dollars using exchange rate #2. */
/* Separate the variables with spaces. */
/*-------------------------------------------------*/
/* THE FOLLOWING FIVE MACRO VARIABLES WILL BE USED */
/* IN PART 11 TO RUN THE COHEN'S-D TEST. */
/*-------------------------------------------------*/
/*----------------------------------------------------------------*/
/* COHEN'S-D TEST */
/* */
/* Normally, the regions will correspond to the 5 Census */
/* regions: Northeast, Midwest, South, West, and Puerto Rico. */
/* (Do not include U.S. Territories other than Puerto Rico */
/* because they are not in the Customs Territory of the U.S.) */
/* */
/* If you have a region variable, type DP_REGION_DATA=REGION */
/* and then specify the region variable in DP_REGION=???. */
/* Please note that any unknown regions should be listed as */
/* blank spaces and not, for example, as "UNKNOWN" or "UNK." */
/* */
/* If you instead have a variable that has either the 2-digit */
/* postal state code or the zip code (5 or 9 digits), then */
/* indicate the same below by typing DP_REGION_DATA=STATE or */
/* DP_REGION_DATA=ZIP. If you need to write your own language */
/* to create the Census regions, do so in Sect. 2-B below */
/* re: changes and edits to the U.S. database. */
/* */
/* If you have any unknown purchasers/customers, they should */
/* be reported as blank spaces and not, for example, as */
/* "UNKNOWN" or "UNK." If this is not the case, please edit */
/* the data accordingly. */
/* */
/* Usually, time periods for purposes of the Cohen's-d Test */
/* will be defined by quarters, beginning with the first month */
/* of POI/POR as found in the B_PERIOD macro variable */
/* defined above. If you wish to use quarters */
/* and do not have a variable for the same, type */
/* DP_TIME_CALC=YES and the program will use the sale date */
/* variable to assign quarters. If you already have a */
/* variable for quarters or are using something other than */
/* quarters, type DP_TIME_CALC=NO and also indicate the */
/* variable containing the time periods in DP_TIME=???. */
/*----------------------------------------------------------------*/
%LET DP_PURCHASER = < >; /*(V) Variable indicating customer for purposes of the */
/* Cohen's-d test. */
%LET DP_REGION_DATA = < >; /*(T) Type either "REGION", "STATE", or "ZIP" (without */
/* quotes) to indicate the type of data being used */
/* to assign Census regions. Then complete the */
/* DP_REGION macro variable immediately following. */
%LET DP_REGION = < >; /*(V) Variable indicating the DP region if you typed */
/* "REGION" for DP_REGION_DATA, or the variable */
/* indicating the 2-digit postal state designation */
/* if you typed "STATE," or the variable indicating */
/* the 5-digit zip code if you typed "ZIP." */
%LET DP_TIME_CALC = <YES/NO>; /*(T) Type "YES" (without quotes) to assign quarters */
/* using the beginning of the period. */
%LET DP_TIME = < >; /*(V) If you typed "NO" for DP_TIME_CALC because you */
/* already have a variable for the DP time period, */
/* indicate that variable here. */
/*-----------------------------------------------------------------*/
/* THE FOLLOWING MACRO WILL BE USED IN PART 7 TO CALCULATE INPUTS. */
/*-----------------------------------------------------------------*/
%MACRO CALCULATE_INPUTS;
/*----------------------------------------------------------------------*/
/* CALCULATE FREIGHT FOR EACH FACTOR OF PRODUCTION TRANSPORTED FROM */
/* A SUPPLIER TO THE MANUFACTURER. */
/* */
/* A SIGMA CAP NEEDS TO BE DETERMINED FOR EACH TRANSPORTED FOP THAT HAS */
/* A SV DERIVED FROM AN IMPORT STATISTIC. DETERMINE WHICH DISTANCE IS */
/* CLOSER TO THE MANUAFACTURER - THE DISTANCE BETWEEN THE RAW MATERIAL */
/* SUPPLIER TO THE FACTORY OR THE DISTANCE BETWEEN THE MANUFACTURER AND */
/* THE NEAREST PORT OF EXIT. MULTIPLY THE SHORTER DISTANCE (THE SIGMA */
/* CAP) BY THE MODE SPECIFIC TRANSPORTATION CHARGE. SOMETIMES THE */
/* RESPONDENT SUPPLIES A SIGMA CAP DISTANCE FOR EACH TRANSPORTED FOP. */
/* WHEN REPORTED, THESE SIGMA CAP DISTANCES CAN BE USED. */
/* */
/* IF THE TRANSPORTED FOP HAS A SV THAT IS NOT DERIVED FROM AN IMPORT */
/* STATISTIC USE THE REPORTED DISTANCE VALUE. */
/* */
/* IN THE FOLLOWING TWO EXAMPLES USE THE FOLLOWING FOUR VARIABLES: */
/* */
/* IRONDIS = THE RESPONDENT REPORTED DISTANCE BETWEEN THE RAW */
/* MATERIAL SUPPLIER TO THE FACTORY. */
/* DINLFTWU = THE REPONDENT REPORTED DISTANCE FROM THE PLANT TO */
/* DISTRIBUTION WAREHOUSE. NOTE: IF THE RESPONDENT */
/* DOES NOT HAVE A DISTRIBUTION WAREHOUSE, DINLFTWU */
/* WILL NOT BE REPORTED AND DOES NOT NEED TO BE USED */
/* IN THESE CALCULATIONS. */
/* DINLFTPU = THE REPONDENT REPORTED DISTANCE FROM THE PLANT OR */
/* DISTRIBUTION WAREHOUSE TO THE NEAREST PORT OF EXIT. */
/* TRUCK_SV = THE DEPARTMENT CALCULATED TRANSPORATION CHARGE. */
/* */
/* ASSUME IRONDIS = 10KM, DINLFTWU = 1KM, AND DINLFTPU = 5KM. */
/* */
/* EXAMPLE WHERE THE FOP SV *IS* DERIVED FROM AN IMPORT STATISTIC: */
/* */
/* IRONORE_FREIGHT = (DINLFTWU + DINLFTPU) * TRUCK_SV; */
/* */
/* EXAMPLE WHERE THE FOP SV *IS NOT* DERIVED FROM AN IMPORT STATISTIC: */
/* */
/* IRONORE_FREIGHT = IRONDIS * TRUCK_SV; */
/* */
/* */
/* THE SIGMA CAP DETERMINATION CAN BE MADE WHERE THE FOP SV *IS* */
/* DERIVED FROM AN IMPORT STATISTIC USING THE MINIMUM FUNCTION. */
/* */
/* EXAMPLE: IRONORE_FREIGHT = MIN(IRONDIS, (DINLFTWU + DINLFTPU)) */
/* * TRUCK_SV; */
/* */
/*----------------------------------------------------------------------*/
/* */
/* CALCULATE EACH INPUT BY ADDING THE FREIGHT CHARGES (IF APPLICABLE) */
/* TO THE SURROGATE VALUE AND MULTIPLYING THE RESULT TO THE FACTOR OF */
/* PRODUCTION. */
/* */
/* NOTE: MAKE SURE TO USE THE SUFFIX '_IN' WHEN NAMING THE INPUT */
/* VARIABLES. THE INPUT VARIABLES WILL BE USED IN A SEPARATE INPUTS */
/* PANELING PROGRAM. */
/* */
/* EXAMPLE: IRONORE_IN = IRONORE * (IRONORE_SV + IRONORE_FREIGHT); */
/* */
/* WHERE: IRONORE = THE RESPONDENT REPORTED FACTOR OF PRODUCTION */
/* IRONORE_SV = THE DEPARTMENT CALCULATED SURROGATE VALUE */
/* IRONORE_FREIGHT = THE DEPARTMENT CALCULATED FREIGHT CHARGE */
/*----------------------------------------------------------------------*/
DATA INPUTS;
SET USSALES;
/* FREIGHT CHARGES (IF ANY) */
<FREIGHT CHARGES (IF ANY)> /* (E) */
/* DIRECT MATERIALS (IF ANY) */
<DIRECT MATERIALS (IF ANY)> /* (E) */
/* ENERGY (IF ANY) */
<ENERGY (IF ANY)> /* (E) */
/* LABOR (IF ANY) */
<LABOR (IF ANY)> /* (E) */
/* PACKING (IF ANY) */
<PACKING (IF ANY)> /* (E) */
/* BY-PRODUCTS (IF ANY) */
<BY-PRODUCTS (IF ANY)> /* (E) */
RUN;
%MEND CALCULATE_INPUTS;
/*------------------------------------------------------------------------*/
/* THE FOLLOWING MACRO WILL BE USED IN PART 8 TO CALCULATE NORMAL VALUES. */
/*------------------------------------------------------------------------*/
%MACRO CALCULATE_NORMAL_VALUES;
DATA NVALUES;
SET INPUTS;
/*-----------------------------------------------*/
/* CALCULATE THE FOLLOWING FIVE VARIABLES USING */
/* INPUTS CREATED ABOVE. IF THERE ARE NO INPUTS */
/* FOR A PARTICULAR VARIABLE, SET THE VARIABLE */
/* TO ZERO. */
/*-----------------------------------------------*/
DIRECT_MATERIAL = < >; /* (E) Sum of the direct material inputs. */
ENERGY = < >; /* (E) Sum of the energy inputs. */
LABOR = < >; /* (E) Sum of the labor inputs except */
/* packing labor. */
PACKING = < >; /* (E) Sum of the packing inputs and */
/* packing labor. */
BY_PRODUCTS = < >; /* (E) Sum of the by-products inputs. */
COM = DIRECT_MATERIAL + ENERGY + LABOR;
OVRHD = COM * OVRHDSV;
TOTCOM = COM + OVRHD;
SGA = TOTCOM * SGASV;
PROFIT = (TOTCOM + SGA) * PROFTSV;
NV = TOTCOM + SGA + PROFIT + PACKING - ABS(BY_PRODUCTS);
RUN;
%MEND CALCULATE_NORMAL_VALUES;
/*----------------------------------------------------------------------------------*/
/* THE FOLLOWING MACRO WILL BE USED IN PARTS 9A AND 9B TO CALCULATE U.S. NET PRICES */
/*----------------------------------------------------------------------------------*/
%MACRO CALCULATE_USNETPRI;
DATA USPRICES;
SET NVALUES;
/*-----------------------------------------------------------------------*/
/* THE FOLLOWING SELECT/WHEN STATEMENT DEFINES THE VARIABLE VETAXU BASED */
/* ON THE VALUES OF THE MACRO VARIABLES VAT_TAX_TYPE AND EXPORT_TAX_TYPE */
/* THAT ARE DEFINED AT THE TOP OF THE PROGRAM. */
/*-----------------------------------------------------------------------*/
%IF &VAT_TAX_TYPE = NONE %THEN
%DO;
VATTAXU = 0;
%END;
%IF &EXPORT_TAX_TYPE = NONE %THEN
%DO;
EXTAXU = 0;
%END;
SELECT ("&VAT_TAX_TYPE &EXPORT_TAX_TYPE");
WHEN ('AMOUNT NONE') VETAXU = VATTAXU;
WHEN ('PERCENTAGE NONE') VETAXU = (&USGUP * VATTAXU);
WHEN ('NONE AMOUNT') VETAXU = EXTAXU;
WHEN ('NONE PERCENTAGE') VETAXU = (&USGUP * EXTAXU);
WHEN ('AMOUNT AMOUNT') VETAXU = VATTAXU + EXTAXU;
WHEN ('AMOUNT PERCENTAGE') VETAXU = VATTAXU + (&USGUP * EXTAXU);
WHEN ('PERCENTAGE PERCENTAGE') VETAXU = (&USGUP * VATTAXU) + (&USGUP * EXTAXU);
WHEN ('PERCENTAGE AMOUNT') VETAXU = (&USGUP * VATTAXU) + EXTAXU;
OTHERWISE VETAXU = 0;
END;
%IF &VAT_TAX_TYPE = NONE %THEN
%DO;
DROP VATTAXU;
%END;
%IF &EXPORT_TAX_TYPE = NONE %THEN
%DO;
DROP EXTAXU;
%END;
/*---------------------------------------------------*/
/* IF A RESPONDENT ADJUSTMENT IS REPORTED IN FOREIGN */
/* CURRENCY MAKE SURE IT HAS BEEN CONVERTED TO U.S. */
/* DOLLARS IN PART 6 BY MULTIPLYING THE ADJUSTMENT */
/* BY THE DAILY EXCHANGE RATE VARIABLE. */
/*---------------------------------------------------*/
/*-----------------------------------------------------*/
/* ADDITIONS TO U.S. STARTING PRICE (IN U.S. DOLLARS). */
/*-----------------------------------------------------*/
GUPADJU = < >; /* (E) Sum of negotiated invoice price, */
/* adjustments, or packing expenses */
/* that are not included in GRSUPRU. */
DISCREBU = < >; /* (E) Sum of U.S. discounts, rebates, and */
/* post-sale agreements. */
DCMMOVEU = < >; /* (E) Sum of all domestic movement expenses */
/* up to delivery along-side the vessel */
/* at the port of export to the U.S. */
/* Usually reported in foreign currency. */
INTLMOVEU = < >; /* (E) Sum of all international and U.S. */
/* movement charges, including U.S. */
/* duties, from loading onto the export */
/* vessel to delivery in U.S. */
%IF %UPCASE(&SALETYPE) = EP OR %UPCASE(&SALETYPE) = BOTH %THEN
%DO;
/*------------------------------------------------*/
/* PART 9A: CALCULATE NET U.S. PRICE FOR EP SALES */
/*------------------------------------------------*/
/*--------------------------------------------------------------*/
/* (E) DETERMINE WHETHER TO REDUCE OR INCREASE THE GROSS UNIT */
/* PRICE BY ADJUSTMENTS (GUPADJU). DEPENDING ON WHETHER THE */
/* VALUE OF GUPADJU IS POSSITIVE OR NEGATIVE, SUBTRACT OR */
/* ADD GUPADJU FROM GROSS UNIT PRICE. */
/*--------------------------------------------------------------*/
IF SALEU = 'EP' THEN
USNETPRI = &USGUP <+/-> GUPADJU - DISCREBU - DCMMOVEU - INTLMOVEU - VETAXU;
%END;
%IF %UPCASE(&SALETYPE) = BOTH %THEN
%DO;
ELSE
%END;
%IF %UPCASE(&SALETYPE) = CEP OR %UPCASE(&SALETYPE) = BOTH %THEN
%DO;
IF SALEU IN ('CEP' 'FMG') THEN
DO;
/*-------------------------------------------------*/
/* PART 9B: CALCULATE NET U.S. PRICE FOR CEP SALES */
/*-------------------------------------------------*/
/*---------------------------------------------------*/
/* IF A RESPONDENT ADJUSTMENT IS REPORTED IN FOREIGN */
/* CURRENCY MAKE SURE IT HAS BEEN CONVERTED TO U.S. */
/* DOLLARS IN PART 6 BY MULTIPLYING THE ADJUSTMENT */
/* BY THE DAILY EXCHANGE RATE VARIABLE. */
/*---------------------------------------------------*/
/*------------------------------------------*/
/* CEP SELLING EXPENSE DEDUCTIONS FROM U.S. */
/* STARTING PRICE THAT ARE INCURRED ON */
/* ECONOMIC ACTIVITY IN THE U.S. MARKET. */
/*------------------------------------------*/
COMMISNU = < >; /* (E) Sum of U.S. commissions. */
CEPIINVCCU = < >; /* (E) Sum of CEP imputed inventory carrying */
/* costs. Typically includes INVENCARU. */
CEPINDSELU = < >; /* (E) Sum of non-imputed indirects. */
/* (E) Typically includes INDIRSU. */
USCREDITU = < >; /* (E) Sum of U.S. imputed credit. */
USDIREXPU = < >; /* (E) Sum of U.S. direct selling expenses, */
/* including repacking and excluding */
/* USCREDITU and COMMISNU. */
USFURMANU = < >; /* (E) Sum of further manufacturing. Should */
/* be zero unless further manufacturing */
/* takes place in the U.S. */
TOTCEPISEL = CEPIINVCCU + CEPINDSELU;
CEPSELLU = COMMISNU + TOTCEPISEL + USCREDITU + USDIREXPU
+ USFURMANU;
CEPROFIT = PROFTSV * CEPSELLU;
/*--------------------------------------------------------------*/
/* (E) DETERMINE WHETHER TO REDUCE OR INCREASE THE GROSS UNIT */
/* PRICE BY ADJUSTMENTS (GUPADJU). DEPENDING ON WHETHER THE */
/* VALUE OF GUPADJU IS POSSITIVE OR NEGATIVE, SUBTRACT OR */
/* ADD GUPADJU FROM GROSS UNIT PRICE. */
/*--------------------------------------------------------------*/
USNETPRI = &USGUP <+/-> GUPADJU - DISCREBU - DCMMOVEU - INTLMOVEU - VETAXU
- CEPROFIT - CEPSELLU;
END;
%END;
RUN;
%MEND CALCULATE_USNETPRI;
/*-----------------------------------*/
/* FORMAT, PROGRAM AND PRINT OPTIONS */
/*-----------------------------------*/
TITLE1 "NME MARGIN CALCULATION PROGRAM - &PRODUCT FROM &COUNTRY - (&BEGINPERIOD - &ENDPERIOD)";
TITLE2 "&SEGMENT &STAGE FOR RESPONDENT &RESPONDENT (&CASE_NUMBER)";
FOOTNOTE1 "*** BUSINESS PROPRIETARY INFORMATION SUBJECT TO APO ***";
FOOTNOTE2 "&BDAY, &BWDATE - &BTIME";
%LET PRINTOBS = 10; /* Number of observations to print. */
OPTION NOSYMBOLGEN; /* SYMBOLGYN prints macro variable resolutions. */
/* Reset to "NOSYMBOLGEN" (without quotes) to */
/* deactivate. */
OPTION MPRINT; /* MPRINT prints macro resolutions, type */
/* "NOMPRINT" (without quotes) to deactivate. */
OPTION NOMLOGIC; /* MLOGIC prints additional info. on macros, */
/* type "MLOGIC" (without quotes) to activate. */
OPTION MINOPERATOR; /* MINOPERATOR is required when using the IN(..) */
/* function in macros. */
OPTION OBS = MAX; /* Indicates the number of OBS to process in each */
/* data set. Default setting of MAX processes all */
/* transactions. If you have large datasets and */
/* initially wish to debug the program using a */
/* limited number of transactions, you can reset */
/* this option by typing in a number. */
OPTION NODATE; /* Suppresses date in header */
OPTION PAGENO = 1; /* Restarts page numbering at Page 1 */
OPTION YEARCUTOFF = 1960; /* Specifies the first year of a 100-year span that */
/* is used to read a two-digit year */
OPTION SPOOL; /* Aids finding location of syntax error in macros */
OPTION VARINITCHK = ERROR; /* An uninitialized variable will generate an ERROR */
OPTION FORMCHAR = '|----|+|---+=|-/\<>*'; /* For printing tables */
%LET COMMA_FORMAT = COMMA12.2; /* Comma format using 12 total spaces and two */
/* decimal places. */
%LET DOLLAR_FORMAT = DOLLAR12.2; /* Dollar format using 12 total spaces and two */
/* decimal places. */
%LET PERCENT_FORMAT = PERCENT7.2; /* Percent format using seven total spaces and */
/* two decimal places. */
%GLOBAL CEP_EXPENSES ENTVALUE IMPORTER USMON USMONTH USCONNUM DE_MINIMIS;
/*------------------------------------------------------------------------------*/
/* DEFINE THE FOLLOWING MACRO VARIABLES: */
/* */
/* USCONNUM: USED TO COMBINE U.S. SALES AND FOP DATA WITH OR WITHOUT */
/* REPORTED MODELS (CONNUMS). */
/* CEP_EXPENSES: USED TO SELECTIVELY PRINT THE VARIABLES CEPROFIT AND */
/* CEPSELLU IN CASES WITH CEP SALES. */
/* ENTVALUE: USED IN REVIEWS TO CALCULATE IMPORTER SPECIFIC DUTY */
/* ASSESSMENT RATES. */
/* IMPORTER: USED IN REVIEWS TO CALCULATE IMPORTER SPECIFIC DUTY */
/* ASSESSMENT RATES. */
/* USMONTH: USED IN REVIEWS TO CREATE MONTHLY AVERAGE NET U.S. PRICES. */
/*------------------------------------------------------------------------------*/
%MACRO DEFINE_MACRO_VARS;
%IF %UPCASE(&CONNUMS) = YES %THEN
%LET USCONNUM = &USCONNUM;
%ELSE
%LET USCONNUM = ;
%IF %UPCASE(&SALETYPE) = EP %THEN
%LET CEP_EXPENSES = ;
%ELSE
%IF %UPCASE(&SALETYPE) = CEP OR %UPCASE(&SALETYPE) = BOTH %THEN
%LET CEP_EXPENSES = CEPROFIT CEPSELLU;
%IF %UPCASE(&CASE_TYPE) = INV %THEN
%DO;
%LET ENTVALUE = ;
%LET IMPORTER = ;
%LET USMONTH = ;
%LET USMON = ;
%LET DE_MINIMIS = 2;
%END;
%ELSE
%IF %UPCASE(&CASE_TYPE) = AR %THEN
%DO;
%IF %UPCASE(&ENTERED_VALUE) = YES %THEN
%LET ENTVALUE = ENTVALUE;
%ELSE
%IF %UPCASE(&ENTERED_VALUE) = NO %THEN
%LET ENTVALUE = ;
%LET USMONTH = USMONTH;
%LET USMON = USMONTH;
%LET DE_MINIMIS = .5;
%END;
%MEND DEFINE_MACRO_VARS;
%DEFINE_MACRO_VARS;
/*---------------------------------------------------------*/
/* IF CONNUMS ARE REPORTED, RUN THE CONNUM UNIQUENESS TEST */
/* TO DETERMINE IF CONNUMS ARE UNIQUE IN THE U.S. AND FOP */
/* DATASETS WHEN MODELS AND PHYSICAL CHARACTERISTICS */
/* DEFINING MODELS ARE REPORTED. */
/*---------------------------------------------------------*/
%MACRO UNIQUE_CONNUMS (DATASET);
%IF %UPCASE(&CONNUMS) = YES %THEN
%DO;
PROC SORT DATA = &DATASET (KEEP = &USCONNUM &USPHVARS)
OUT = CONNUM_CHECK NODUPKEY;
BY &USCONNUM &USPHVARS;
RUN;
DATA NOT_UNIQUE_CONNUMS (DROP = COUNT UNIQUE)
UNIQUE_CONNUMS (KEEP = UNIQUE);
SET CONNUM_CHECK END = EOF;
BY &USCONNUM;
IF NOT (FIRST.&USCONNUM AND LAST.&USCONNUM) THEN
DO;
COUNT + 1;
OUTPUT NOT_UNIQUE_CONNUMS;
END;
ELSE